Commit 35bbaa66 authored by James Almer's avatar James Almer

avformat: use avpriv_mpeg4audio_get_config2()

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent d582cc17
......@@ -53,7 +53,7 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
int off;
init_get_bits(&gb, buf, size * 8);
off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s);
if (off < 0)
return off;
skip_bits_long(&gb, off);
......
......@@ -547,8 +547,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
return ret;
if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
MPEG4AudioConfig cfg = {0};
ret = avpriv_mpeg4audio_get_config(&cfg, st->codecpar->extradata,
st->codecpar->extradata_size * 8, 1);
ret = avpriv_mpeg4audio_get_config2(&cfg, st->codecpar->extradata,
st->codecpar->extradata_size, 1, fc);
if (ret < 0)
return ret;
st->codecpar->channels = cfg.channels;
......
......@@ -62,7 +62,7 @@ static int latm_decode_extradata(AVFormatContext *s, uint8_t *buf, int size)
av_log(s, AV_LOG_ERROR, "Extradata is larger than currently supported.\n");
return AVERROR_INVALIDDATA;
}
ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
ctx->off = avpriv_mpeg4audio_get_config2(&m4ac, buf, size, 1, s);
if (ctx->off < 0)
return ctx->off;
......
......@@ -717,8 +717,7 @@ static int get_aac_sample_rates(AVFormatContext *s, uint8_t *extradata, int extr
MPEG4AudioConfig mp4ac;
int ret;
ret = avpriv_mpeg4audio_get_config(&mp4ac, extradata,
extradata_size * 8, 1);
ret = avpriv_mpeg4audio_get_config2(&mp4ac, extradata, extradata_size, 1, s);
/* Don't abort if the failure is because of missing extradata. Assume in that
* case a bitstream filter will provide the muxer with the extradata in the
* first packet.
......
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