Revision 7c152a45 libavformat/utils.c
libavformat/utils.c | ||
---|---|---|
2217 | 2217 |
|
2218 | 2218 |
/* check if one codec still needs to be handled */ |
2219 | 2219 |
for(i=0;i<ic->nb_streams;i++) { |
2220 |
int fps_analyze_framecount = 20; |
|
2221 |
|
|
2220 | 2222 |
st = ic->streams[i]; |
2221 | 2223 |
if (!has_codec_parameters(st->codec)) |
2222 | 2224 |
break; |
2225 |
/* if the timebase is coarse (like the usual millisecond precision |
|
2226 |
of mkv), we need to analyze more frames to reliably arrive at |
|
2227 |
the correct fps */ |
|
2228 |
if (av_q2d(st->time_base) > 0.0005) |
|
2229 |
fps_analyze_framecount *= 2; |
|
2223 | 2230 |
/* variable fps and no guess at the real fps */ |
2224 | 2231 |
if( tb_unreliable(st->codec) && !(st->r_frame_rate.num && st->avg_frame_rate.num) |
2225 |
&& st->info->duration_count<20 && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
2232 |
&& st->info->duration_count < fps_analyze_framecount |
|
2233 |
&& st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
2226 | 2234 |
break; |
2227 | 2235 |
if(st->parser && st->parser->parser->split && !st->codec->extradata) |
2228 | 2236 |
break; |
Also available in: Unified diff