Mercurial > libavcodec.hg
changeset 9873:88c0a9c62987 libavcodec
Fix yamaha adpcm stereo (issue 1117).
Patch by Yoshihisa Uchida, yoshihisa D uchida A gmail
author | cehoyos |
---|---|
date | Sat, 20 Jun 2009 13:07:21 +0000 |
parents | 01ccb357a33c |
children | ee966d1064a2 |
files | adpcm.c |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/adpcm.c Sat Jun 20 11:22:25 2009 +0000 +++ b/adpcm.c Sat Jun 20 13:07:21 2009 +0000 @@ -648,14 +648,11 @@ *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: