diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-02 03:16:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-02 03:21:55 +0200 |
commit | 701dd6eab0e9ad910073c9823319091ea20723dc (patch) | |
tree | a444947bc0ca535564996398e7a1af9df9f4233c /libavformat | |
parent | ace432f62cdcedf812e7c4d77fc5b03322170fa8 (diff) | |
parent | f5d14a92cb6aebd0bac3599847d6302842115e3f (diff) | |
download | ffmpeg-701dd6eab0e9ad910073c9823319091ea20723dc.tar.gz |
Merge remote branch 'qatar/release/0.6' into release/0.6
* qatar/release/0.6:
Release notes for 0.6.3
update Changelog
Duplicate AMV: disable DR1 and don't override EMU_EDGE
lavf: inspect more frames for fps when container time base is coarse
Duplicate Fix races in default av_log handler
aac: add headers needed for log2f()
mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
Conflicts:
Changelog
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 6224a35d4d..b73d98473f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2205,12 +2205,20 @@ int av_find_stream_info(AVFormatContext *ic) /* check if one codec still needs to be handled */ for(i=0;i<ic->nb_streams;i++) { + int fps_analyze_framecount = 20; + st = ic->streams[i]; if (!has_codec_parameters(st->codec)) break; + /* if the timebase is coarse (like the usual millisecond precision + of mkv), we need to analyze more frames to reliably arrive at + the correct fps */ + if (av_q2d(st->time_base) > 0.0005) + fps_analyze_framecount *= 2; /* variable fps and no guess at the real fps */ if( tb_unreliable(st->codec) && !(st->r_frame_rate.num && st->avg_frame_rate.num) - && duration_count[i]<20 && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) + && duration_count[i] < fps_analyze_framecount + && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) break; if(st->parser && st->parser->parser->split && !st->codec->extradata) break; |