aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_utils.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-10 19:30:56 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-10 19:30:56 +0000
commit85f2ce820f7299c1b10ce71c606dfc0f36e7fc74 (patch)
treec8db77127efe5d9d215e2487db900b5d6c99dd52 /src/pcm_utils.c
parent5b4a0a1821aa959bfabcf480da1899e750be2b25 (diff)
downloadmpd-85f2ce820f7299c1b10ce71c606dfc0f36e7fc74.tar.gz
mpd-85f2ce820f7299c1b10ce71c606dfc0f36e7fc74.tar.xz
mpd-85f2ce820f7299c1b10ce71c606dfc0f36e7fc74.zip
fix a bug in channel conversion
git-svn-id: https://svn.musicpd.org/mpd/trunk@975 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/pcm_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c
index c1be8d167..e7872a272 100644
--- a/src/pcm_utils.c
+++ b/src/pcm_utils.c
@@ -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++) {