avformat: Fix decoder search in find stream info
Fixes Ticket3548
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3743901d7
)
This commit is contained in:

committed by
Carl Eugen Hoyos

parent
30cf47c6f0
commit
0385c824f1
@@ -2623,13 +2623,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;
|
||||
}
|
||||
@@ -2641,7 +2643,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;
|
||||
|
Reference in New Issue
Block a user