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>
This commit is contained in:
parent
e2691b8092
commit
80fa48a413
@ -3136,9 +3136,13 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
fps_analyze_framecount = 0;
|
fps_analyze_framecount = 0;
|
||||||
/* variable fps and no guess at the real fps */
|
/* variable fps and no guess at the real fps */
|
||||||
if (!(st->r_frame_rate.num && st->avg_frame_rate.num) &&
|
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) {
|
||||||
st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
int count = (ic->iformat->flags & AVFMT_NOTIMESTAMPS) ?
|
||||||
break;
|
st->info->codec_info_duration_fields/2 :
|
||||||
|
st->info->duration_count;
|
||||||
|
if (count < fps_analyze_framecount)
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (st->parser && st->parser->parser->split &&
|
if (st->parser && st->parser->parser->split &&
|
||||||
!st->codec->extradata)
|
!st->codec->extradata)
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user