lavf: add AVFormatContext.max_ts_probe

It allows to configure how long will avformat_find_stream_info() wait
to get the first timestamp.
This commit is contained in:
Anton Khirnov 2014-08-19 17:49:58 +00:00
parent 6ca11f7157
commit b263f8ffe7
5 changed files with 12 additions and 1 deletions

View file

@ -2108,6 +2108,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
!st->codec->extradata)
break;
if (st->first_dts == AV_NOPTS_VALUE &&
st->codec_info_nb_frames < ic->max_ts_probe &&
(st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
break;