From: van Date: Wed, 1 Apr 2009 04:40:08 +0000 (+0000) Subject: Fix frame rate calculation for ffmpeg 0.5 - h.264 rate is now in fields per second... X-Git-Tag: 0.9.4~674 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=687930925f509a27928887d34546d7bea87b99a3;p=handbrake Fix frame rate calculation for ffmpeg 0.5 - h.264 rate is now in fields per second so convert it back to frames per second. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2288 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index e5c8fd10c..532059706 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -895,6 +895,12 @@ static int decavcodecvInfo( hb_work_object_t *w, hb_work_info_t *info ) info->rate = 27000000; info->rate_base = (int64_t)context->time_base.num * 27000000LL / context->time_base.den; + if ( context->ticks_per_frame > 1 ) + { + // for ffmpeg 0.5 & later, the H.264 & MPEG-2 time base is + // field rate rather than frame rate so convert back to frames. + info->rate_base *= context->ticks_per_frame; + } /* Sometimes there's no pixel aspect set in the source. In that case, assume a 1:1 PAR. Otherwise, preserve the source PAR. */