diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-18 00:58:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-18 02:18:55 +0200 |
commit | 80fa48a413a066a87e1a5683d248ce921a444292 (patch) | |
tree | faea264a32e8a2ecb6d4689d3f0f26ef79b3f017 /libavformat/utils.c | |
parent | e2691b809271b311c088075ad79f8f775258fd14 (diff) | |
download | ffmpeg-80fa48a413a066a87e1a5683d248ce921a444292.tar.gz |
avformat/utils: Use codec_info_duration_fields in fps calculation end decission when no timestamps and thus no duration_count is available
This avoids waiting for a count to increase which will always be 0 and may
reduce the startup delay for affected streams (rare)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 6c7ca0acc1..15aaa700cf 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3136,9 +3136,13 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) fps_analyze_framecount = 0; /* variable fps and no guess at the real fps */ if (!(st->r_frame_rate.num && st->avg_frame_rate.num) && - st->info->duration_count < fps_analyze_framecount && - st->codec->codec_type == AVMEDIA_TYPE_VIDEO) - break; + st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + int count = (ic->iformat->flags & AVFMT_NOTIMESTAMPS) ? + st->info->codec_info_duration_fields/2 : + st->info->duration_count; + if (count < fps_analyze_framecount) + break; + } if (st->parser && st->parser->parser->split && !st->codec->extradata) break; |