diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-10-08 17:49:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-10-10 00:59:51 +0200 |
commit | 08eef74a39d73bec80d4a12f0eaca6a3602a2024 (patch) | |
tree | 4825f35a9624f3347851274296f7cbfbf5f7bfc5 /libavformat | |
parent | 7fefd776682ae9a138d808f8e91e8c74574187db (diff) | |
download | ffmpeg-08eef74a39d73bec80d4a12f0eaca6a3602a2024.tar.gz |
avformat/utils: Update codec_id before using it in the parser init
Fixes assertion failure
Fixes: input.avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 987690799dd86433bf98b897aaa4c8d93ade646d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 5be1e869cf..8dc287f202 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3328,6 +3328,17 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) if (!avctx->time_base.num) avctx->time_base = st->time_base; } + + /* check if the caller has overridden the codec id */ +#if FF_API_LAVF_AVCTX +FF_DISABLE_DEPRECATION_WARNINGS + if (st->codec->codec_id != st->internal->orig_codec_id) { + st->codecpar->codec_id = st->codec->codec_id; + st->codecpar->codec_type = st->codec->codec_type; + st->internal->orig_codec_id = st->codec->codec_id; + } +FF_ENABLE_DEPRECATION_WARNINGS +#endif // only for the split stuff if (!st->parser && !(ic->flags & AVFMT_FLAG_NOPARSE) && st->request_probe <= 0) { st->parser = av_parser_init(st->codecpar->codec_id); @@ -3344,16 +3355,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) } } - /* check if the caller has overridden the codec id */ -#if FF_API_LAVF_AVCTX -FF_DISABLE_DEPRECATION_WARNINGS - if (st->codec->codec_id != st->internal->orig_codec_id) { - st->codecpar->codec_id = st->codec->codec_id; - st->codecpar->codec_type = st->codec->codec_type; - st->internal->orig_codec_id = st->codec->codec_id; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (st->codecpar->codec_id != st->internal->orig_codec_id) st->internal->orig_codec_id = st->codecpar->codec_id; |