You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/adpcm_ima_apm: support new extradata format
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
a705bcd763
commit
b35968e060
@@ -162,11 +162,18 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_ADPCM_IMA_APM:
|
case AV_CODEC_ID_ADPCM_IMA_APM:
|
||||||
if (avctx->extradata && avctx->extradata_size >= 16) {
|
if (avctx->extradata) {
|
||||||
c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 0), 18);
|
if (avctx->extradata_size >= 28) {
|
||||||
c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88);
|
c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 16), 18);
|
||||||
c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 8), 18);
|
c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 20), 0, 88);
|
||||||
c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88);
|
c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 4), 18);
|
||||||
|
c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 8), 0, 88);
|
||||||
|
} else if (avctx->extradata_size >= 16) {
|
||||||
|
c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 0), 18);
|
||||||
|
c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88);
|
||||||
|
c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 8), 18);
|
||||||
|
c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_ADPCM_IMA_WS:
|
case AV_CODEC_ID_ADPCM_IMA_WS:
|
||||||
|
Reference in New Issue
Block a user