diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-11-13 05:15:55 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-11-13 05:15:55 +0000 |
commit | a47d3c044248baf5d52997cf7d5efe11ad0cf31e (patch) | |
tree | 0df815bf1d7f3aba6ad3c80e160ad1365f7987ce | |
parent | 6c0d04136f1b81f267dc4636bc2e764c55601525 (diff) | |
download | ffmpeg-a47d3c044248baf5d52997cf7d5efe11ad0cf31e.tar.gz |
Output proper 16-bit sound (fixes decoding on PPC)
Originally committed as revision 7000 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vmdav.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 359b23717e..394d6d50d8 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -484,10 +484,13 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data, } else { if (s->bits == 16) vmdaudio_decode_audio(s, data, buf, 1); - else + else { /* copy the data but convert it to signed */ - for (i = 0; i < s->block_align; i++) - data[i * 2 + 1] = buf[i] + 0x80; + for (i = 0; i < s->block_align; i++){ + *data++ = buf[i] + 0x80; + *data++ = buf[i] + 0x80; + } + } } } else { bytes_decoded = s->block_align * 2; @@ -500,8 +503,10 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data, vmdaudio_decode_audio(s, data, buf, 0); } else { /* copy the data but convert it to signed */ - for (i = 0; i < s->block_align; i++) - data[i * 2 + 1] = buf[i] + 0x80; + for (i = 0; i < s->block_align; i++){ + *data++ = buf[i] + 0x80; + *data++ = buf[i] + 0x80; + } } } } |