summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
authorYoshihisa Uchida <yoshihisa.uchida@gmail.com>2009-06-20 13:07:21 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-06-20 13:07:21 +0000
commitd8b2d834735cc83c5681bcb0b63837e8c37d2686 (patch)
tree78a25563210f050985a6ef202e154e493663521c /libavcodec/adpcm.c
parent3f3f3ba799587cfd27d6011b19784bc30864b32f (diff)
downloadffmpeg-d8b2d834735cc83c5681bcb0b63837e8c37d2686.tar.gz
Fix yamaha adpcm stereo (issue 1117).
Patch by Yoshihisa Uchida, yoshihisa D uchida A gmail Originally committed as revision 19237 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 8184378a16..4d2146f23a 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -648,14 +648,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
*dst++ = buf[0][i] | (buf[1][i] << 4);
}
} else
- for (; n>0; n--) {
- for(i = 0; i < avctx->channels; i++) {
- int nibble;
- nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]);
- nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4;
- *dst++ = nibble;
- }
- samples += 2 * avctx->channels;
+ for (n *= avctx->channels; n>0; n--) {
+ int nibble;
+ nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
+ nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
+ *dst++ = nibble;
}
break;
default: