I rewritten as follow .

				const int MAX_CONFIG_VOLUME = 10;
				s16* out = (s16*)outbuf;
				memset(out, 0, ATRAC3PLUS_MAX_SAMPLES * sizeof(s16) * atrac->atracOutputChannels);
				int gotsize = atrac->sampleQueue.pop_front(buf, ATRAC3PLUS_MAX_SAMPLES * sizeof(s16) * atrac->atracChannels);
				numSamples = gotsize / sizeof(s16) / atrac->atracChannels;
				s16* in = (s16*)buf;
				for (u32 i = 0; i < numSamples; i++) {
					s16 sampleL = *in++ >> (MAX_CONFIG_VOLUME - g_Config.iBGMVolume);
					s16 sampleR = sampleL;
					if (atrac->atracChannels == 2)
						sampleR = *in++ >> (MAX_CONFIG_VOLUME - g_Config.iBGMVolume);