Browse Source

adpcmenc: ensure calls to adpcm_ima_compress_sample() are in the right order

Should fix fate-acodec-adpcm-ima_wav with several compilers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Justin Ruggles Michael Niedermayer 12 years ago
parent
commit
d58b25aaa2
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavcodec/adpcmenc.c

+ 3
- 2
libavcodec/adpcmenc.c View File

@@ -538,8 +538,9 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ADPCMChannelStatus *status = &c->status[ch];
const int16_t *smp = &samples_p[ch][1 + i * 8];
for (j = 0; j < 8; j += 2) {
*dst++ = adpcm_ima_compress_sample(status, smp[j ]) |
(adpcm_ima_compress_sample(status, smp[j + 1]) << 4);
uint8_t v = adpcm_ima_compress_sample(status, smp[j ]);
v |= (adpcm_ima_compress_sample(status, smp[j + 1]) << 4);
*dst++ = v;
}
}
}


Loading…
Cancel
Save