1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

fix r_frame_rate detection in mpeg4 streams with non integer fps

Originally committed as revision 6544 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-10-03 19:13:27 +00:00
parent 7f778ed111
commit 5523d5f41e

View File

@ -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){ if (!st->r_frame_rate.num){
st->r_frame_rate.num = st->codec->time_base.den; if( st->codec->time_base.den * (int64_t)st->time_base.num
st->r_frame_rate.den = st->codec->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;
}
} }
} }
} }