diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-21 03:38:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-21 05:27:08 +0200 |
commit | f3743901d7df906342f99b179382b19d8a4d9716 (patch) | |
tree | 0af330362a4d6885ad96c30a63d35b44b87ede50 /libavformat/utils.c | |
parent | 369cdf917aaa5d7fbc61d57f87e638772e806716 (diff) | |
download | ffmpeg-f3743901d7df906342f99b179382b19d8a4d9716.tar.gz |
avformat: Fix decoder search in find stream info
Fixes Ticket3548
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e1dfe02b6c..3122257b96 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2655,13 +2655,15 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, if (!frame) return AVERROR(ENOMEM); - if (!avcodec_is_open(st->codec) && !st->info->found_decoder) { + if (!avcodec_is_open(st->codec) && + st->info->found_decoder <= 0 && + (st->codec->codec_id != -st->info->found_decoder || !st->codec->codec_id)) { AVDictionary *thread_opt = NULL; codec = find_decoder(s, st, st->codec->codec_id); if (!codec) { - st->info->found_decoder = -1; + st->info->found_decoder = -st->codec->codec_id; ret = -1; goto fail; } @@ -2673,7 +2675,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt, if (!options) av_dict_free(&thread_opt); if (ret < 0) { - st->info->found_decoder = -1; + st->info->found_decoder = -st->codec->codec_id; goto fail; } st->info->found_decoder = 1; |