diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-16 01:53:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-16 02:46:11 +0200 |
commit | d267a0f8c1a8f950abe0043dc7b9b29835ed1dc2 (patch) | |
tree | 6bcbbad13ccdaaa6e2297319c00f00c470b9a201 /libavformat | |
parent | 004f1c6cf13a7f3b6273d693b256d9d85bbc50bd (diff) | |
download | ffmpeg-d267a0f8c1a8f950abe0043dc7b9b29835ed1dc2.tar.gz |
avformat/util: Simplify av_guess_frame_rate() by using AVCodecContext.framerate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index a50d6f441a..7919cc47d6 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4104,7 +4104,7 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *frame) { AVRational fr = st->r_frame_rate; - AVRational codec_fr = av_inv_q(st->codec->time_base); + AVRational codec_fr = st->codec->framerate; AVRational avg_fr = st->avg_frame_rate; if (avg_fr.num > 0 && avg_fr.den > 0 && fr.num > 0 && fr.den > 0 && @@ -4114,7 +4114,6 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f if (st->codec->ticks_per_frame > 1) { - codec_fr.den *= st->codec->ticks_per_frame; if ( codec_fr.num > 0 && codec_fr.den > 0 && av_q2d(codec_fr) < av_q2d(fr)*0.7 && fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1) fr = codec_fr; |