]> granicus.if.org Git - handbrake/commitdiff
Scan: fix some 24000/1001 sources being detected as "almost" 24000/1001, using is_clo...
authorRodeo <tdskywalker@gmail.com>
Wed, 2 May 2012 23:33:19 +0000 (23:33 +0000)
committerRodeo <tdskywalker@gmail.com>
Wed, 2 May 2012 23:33:19 +0000 (23:33 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4631 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/scan.c

index ad95565284615489ab2090c893b55787925236f3..1f222ac7a48843ad53b24e3ef6c632a02657ee5f 100644 (file)
@@ -856,9 +856,20 @@ skip_preview:
         title->height = vid_info.height;
         if ( vid_info.rate && vid_info.rate_base )
         {
+            // if the frame rate is very close to one of our "common" framerates,
+            // assume it actually is said frame rate; e.g. some 24000/1001 sources
+            // may have a rate_base of 1126124 (instead of 1126125)
+            for( i = 0; i < hb_video_rates_count; i++ )
+            {
+                if( is_close_to( vid_info.rate_base, hb_video_rates[i].rate, 100 ) )
+                {
+                    vid_info.rate_base = hb_video_rates[i].rate;
+                    break;
+                }
+            }
             title->rate = vid_info.rate;
             title->rate_base = vid_info.rate_base;
-            if( is_close_to( vid_info.rate_base, 900900, 100 ) )
+            if( vid_info.rate_base == 900900 )
             {
                 if( pulldown_count >= npreviews / 4 )
                 {