diff options
author | jstebbins <[email protected]> | 2010-11-05 23:29:31 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-11-05 23:29:31 +0000 |
commit | f93538e651593c3898199b36150ffd3c71074330 (patch) | |
tree | b7f70cdc8fe38a4d0524d5ce9826d1041dbce3d5 | |
parent | 87f6546defc189877fefc14caf6928773c06f5b2 (diff) |
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://svn.handbrake.fr/HandBrake/trunk@3650 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/decavcodec.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 379365b57..f49759392 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; |