Commit 01a01bf8 authored by Paul B Mahol's avatar Paul B Mahol Committed by Janne Grunau

adpcm: fix IMA SMJPEG decoding

Signed-off-by: 's avatarJanne Grunau <janne-libav@jannau.net>
parent c32e4029
...@@ -1001,11 +1001,15 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1001,11 +1001,15 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
break; break;
case CODEC_ID_ADPCM_IMA_AMV: case CODEC_ID_ADPCM_IMA_AMV:
case CODEC_ID_ADPCM_IMA_SMJPEG: case CODEC_ID_ADPCM_IMA_SMJPEG:
c->status[0].predictor = (int16_t)bytestream_get_le16(&src); if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) {
c->status[0].step_index = bytestream_get_le16(&src); c->status[0].predictor = sign_extend(bytestream_get_le16(&src), 16);
c->status[0].step_index = bytestream_get_le16(&src);
if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) src += 4;
src+=4; } else {
c->status[0].predictor = sign_extend(bytestream_get_be16(&src), 16);
c->status[0].step_index = bytestream_get_byte(&src);
src += 1;
}
for (n = nb_samples >> (1 - st); n > 0; n--, src++) { for (n = nb_samples >> (1 - st); n > 0; n--, src++) {
char hi, lo; char hi, lo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment