]> granicus.if.org Git - handbrake/commitdiff
Fix frame rate calculation for ffmpeg 0.5 - h.264 rate is now in fields per second...
authorvan <vanj.hb@gmail.com>
Wed, 1 Apr 2009 04:40:08 +0000 (04:40 +0000)
committervan <vanj.hb@gmail.com>
Wed, 1 Apr 2009 04:40:08 +0000 (04:40 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2288 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decavcodec.c

index e5c8fd10c844c54ceafa8c7541c2147d2d5e77b1..5320597062408b7a16c17afff04885956741e9ea 100644 (file)
@@ -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.             */