# HG changeset patch # User cehoyos # Date 1245503241 0 # Node ID 88c0a9c6298751a66b3c155350df02adc9541aec # Parent 01ccb357a33cc48e75027e4c6b2e8bf7d7fa607f Fix yamaha adpcm stereo (issue 1117). Patch by Yoshihisa Uchida, yoshihisa D uchida A gmail diff -r 01ccb357a33c -r 88c0a9c62987 adpcm.c --- 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: