Commit fbfee6ad authored by Vittorio Giovara's avatar Vittorio Giovara

aac: Rework extradata parsing code

- enable the parsing code
- use the new buffer instead of replacing the context one
- do not push/pop configuration, just discard the exiting one
- propagate errors correctly
parent 42483650
...@@ -3324,20 +3324,14 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, ...@@ -3324,20 +3324,14 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
AV_PKT_DATA_JP_DUALMONO, AV_PKT_DATA_JP_DUALMONO,
&jp_dualmono_size); &jp_dualmono_size);
if (new_extradata && 0) { if (new_extradata) {
av_free(avctx->extradata); /* discard previous configuration */
avctx->extradata = av_mallocz(new_extradata_size + ac->oc[1].status = OC_NONE;
AV_INPUT_BUFFER_PADDING_SIZE); err = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
if (!avctx->extradata) new_extradata,
return AVERROR(ENOMEM); new_extradata_size * 8LL, 1);
avctx->extradata_size = new_extradata_size; if (err < 0) {
memcpy(avctx->extradata, new_extradata, new_extradata_size); return err;
push_output_configuration(ac);
if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
avctx->extradata,
avctx->extradata_size*8LL, 1) < 0) {
pop_output_configuration(ac);
return AVERROR_INVALIDDATA;
} }
} }
......
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