From: jstebbins Date: Fri, 5 Nov 2010 23:29:31 +0000 (+0000) Subject: fix framerate detection again (really, i mean it this time) X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=c8df6fab888a342e8b1dfc61b1580e91c7a1e31f;p=handbrake-jp%2Fhandbrake-jp-git.git fix framerate detection again (really, i mean it this time) integer overflow was causing our sanity checks of ffmpegs frame rate to fail. We would then fall back to using less accurate values. Also removes the completely incorrect adjustment that I made based on ticks_per_frame. That is only useful in a different code path. git-svn-id: svn://localhost/HandBrake/trunk@3650 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 379365b5..f4975939 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -1180,19 +1180,19 @@ static void init_ffmpeg_context( hb_work_object_t *w ) // Because the time bases are so screwed up, we only take values // in the range 8fps - 64fps. AVRational tb; - if ( st->avg_frame_rate.den * 64 > st->avg_frame_rate.num && - st->avg_frame_rate.num > st->avg_frame_rate.den * 8 ) + if ( st->avg_frame_rate.den * 64L > st->avg_frame_rate.num && + st->avg_frame_rate.num > st->avg_frame_rate.den * 8L ) { tb.num = st->avg_frame_rate.den; tb.den = st->avg_frame_rate.num; } - else if ( st->time_base.num * 64 > st->time_base.den && - st->time_base.den > st->time_base.num * 8 ) + else if ( st->time_base.num * 64L > st->time_base.den && + st->time_base.den > st->time_base.num * 8L ) { tb = st->time_base; } - else if ( st->r_frame_rate.den * 64 > st->r_frame_rate.num && - st->r_frame_rate.num > st->r_frame_rate.den * 8 ) + else if ( st->r_frame_rate.den * 64L > st->r_frame_rate.num && + st->r_frame_rate.num > st->r_frame_rate.den * 8L ) { tb.num = st->r_frame_rate.den; tb.den = st->r_frame_rate.num; @@ -1332,10 +1332,6 @@ static int decavcodecviInfo( hb_work_object_t *w, hb_work_info_t *info ) // need it in units of the 27MHz MPEG clock. */ info->rate = 27000000; info->rate_base = pv->duration * 300.; - if ( pv->context->ticks_per_frame > 1 ) - { - info->rate_base *= 2; - } return 1; } return 0;