1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavf/utils: avoid giving up probing early with long subtitle events

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Rodger Combs 2015-10-02 22:39:24 -05:00 committed by Michael Niedermayer
parent 85c92789b6
commit 9825a24e5b

View File

@ -3347,7 +3347,10 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
if (pkt->duration) {
st->info->codec_info_duration += pkt->duration;
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && pkt->pts >= st->start_time) {
st->info->codec_info_duration = FFMIN(pkt->pts - st->start_time, st->info->codec_info_duration + pkt->duration);
} else
st->info->codec_info_duration += pkt->duration;
st->info->codec_info_duration_fields += st->parser && st->need_parsing && st->codec->ticks_per_frame ==2 ? st->parser->repeat_pict + 1 : 2;
}
}