diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-03 19:13:27 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-03 19:13:27 +0000 |
commit | 5523d5f41ef1b47bf262c333e504f589668ed30f (patch) | |
tree | 80c423a284bb49d18733e0543328431fcaf08777 /libavformat/utils.c | |
parent | 7f778ed111aa09a3f36782195eea84233f33ad73 (diff) | |
download | ffmpeg-5523d5f41ef1b47bf262c333e504f589668ed30f.tar.gz |
fix r_frame_rate detection in mpeg4 streams with non integer fps
Originally committed as revision 6544 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 09be967708..1405d2c09a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1961,10 +1961,15 @@ int av_find_stream_info(AVFormatContext *ic) } } - /* if no real frame rate, use the codec one */ if (!st->r_frame_rate.num){ - st->r_frame_rate.num = st->codec->time_base.den; - st->r_frame_rate.den = st->codec->time_base.num; + if( st->codec->time_base.den * (int64_t)st->time_base.num + <= st->codec->time_base.num * (int64_t)st->time_base.den){ + st->r_frame_rate.num = st->codec->time_base.den; + st->r_frame_rate.den = st->codec->time_base.num; + }else{ + st->r_frame_rate.num = st->time_base.den; + st->r_frame_rate.den = st->time_base.num; + } } } } |