OSDN Git Service

Now that the interfaces don't set job->vfr to 1 unless detelecine is enabled, libhb...
authorjbrjake <jbrjake@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 26 Sep 2008 17:59:04 +0000 (17:59 +0000)
committerjbrjake <jbrjake@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 26 Sep 2008 17:59:04 +0000 (17:59 +0000)
Also adds a sanity check to make sure frames aren't dropped in the AVI container, for those masochstic enough to use the format.

git-svn-id: svn://localhost/HandBrake/trunk@1774 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/work.c

index bb4cfc7..c283f22 100644 (file)
@@ -401,37 +401,17 @@ static void do_job( hb_job_t * job, int cpu_count )
         hb_log( "New dimensions %i * %i", job->width, job->height );
     }
 
+    if( ( job->mux & HB_MUX_AVI ) || job->cfr )
+    {
+        /* VFR detelecine is not compatible with AVI or constant frame rates. */
+        job->vfr = 0;
+    }
+
     if ( job->vfr )
     {
+        /* Ensure we're using "Same as source" FPS,
+           aka VFR, if we're doing VFR detelecine. */
         job->vrate_base = title->rate_base;
-
-        int detelecine_present = 0;
-        if ( job->filters )
-        {
-            for( i = 0; i < hb_list_count( job->filters ); i++ )
-            {
-                hb_filter_object_t * filter = hb_list_item( job->filters, i );
-                if (filter->id == FILTER_DETELECINE)
-                    detelecine_present = 1;
-            }
-        }
-
-        if (!detelecine_present)
-        {
-            /* Allocate the filter. */
-            hb_filter_object_t * filter =  malloc( sizeof( hb_filter_object_t ) );
-
-            /* Copy in the contents of the detelecine struct. */
-            memcpy( filter, &hb_filter_detelecine, sizeof( hb_filter_object_t ) );
-
-            /* Set the name to a copy of the template name so render.c has something to free. */
-            filter->name = strdup(hb_filter_detelecine.name);
-
-            /* Add it to the list. */
-            hb_list_add( job->filters, filter );
-
-            hb_log("work: VFR mode -- adding detelecine filter");
-        }
     }
 
     job->fifo_mpeg2  = hb_fifo_init( 256 );