fix a bug in channel conversion

git-svn-id: https://svn.musicpd.org/mpd/trunk@975 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-05-10 19:30:56 +00:00
parent 5b4a0a1821
commit 85f2ce820f

View File

@ -197,7 +197,7 @@ void pcm_convertAudioFormat(AudioFormat * inFormat, char * inBuffer, size_t
{
mpd_sint16 * in = (mpd_sint16 *)dataBitConv;
mpd_sint16 * out = (mpd_sint16 *)dataChannelConv;
int i, inSamples = dataChannelLen >> 1;
int i, inSamples = dataBitLen >> 1;
for(i=0;i<inSamples;i++) {
*out++ = *in;
*out++ = *in++;
@ -227,7 +227,7 @@ void pcm_convertAudioFormat(AudioFormat * inFormat, char * inBuffer, size_t
(mpd_uint32)(outFormat->sampleRate)) /
inFormat->sampleRate);
nlen <<= shift;
in_samples = inSize >> shift;
in_samples = dataChannelLen >> shift;
out_samples = nlen >> shift;
delta = (in_samples << 12) / out_samples;
for(x = 0, i = 0; i < out_samples; i++) {