OSDN Git Service

Don't display a mixdown in the job settings for passthrough audio tracks.
[handbrake-jp/handbrake-jp-git.git] / libhb / work.c
index 480e86b..64b0617 100644 (file)
@@ -294,11 +294,14 @@ hb_display_job_info( hb_job_t * job )
                 hb_log( "     + bitrate: %d kbps, samplerate: %d Hz", audio->config.in.bitrate / 1000, audio->config.in.samplerate );
             }
 
-            for (j = 0; j < hb_audio_mixdowns_count; j++)
+            if( (audio->config.out.codec != HB_ACODEC_AC3) && (audio->config.out.codec != HB_ACODEC_DCA) )
             {
-                if (hb_audio_mixdowns[j].amixdown == audio->config.out.mixdown) {
-                    hb_log( "   + mixdown: %s", hb_audio_mixdowns[j].human_readable_name );
-                    break;
+                for (j = 0; j < hb_audio_mixdowns_count; j++)
+                {
+                    if (hb_audio_mixdowns[j].amixdown == audio->config.out.mixdown) {
+                        hb_log( "   + mixdown: %s", hb_audio_mixdowns[j].human_readable_name );
+                        break;
+                    }
                 }
             }
 
@@ -383,56 +386,35 @@ static void do_job( hb_job_t * job, int cpu_count )
         }
     }
 
-       /* Keep width and height within these boundaries,
-          but ignore for "loose" anamorphic encodes, for
-          which this stuff is covered in the pixel_ratio
-          section right above.*/
-       if (job->maxHeight && (job->height > job->maxHeight) && (job->pixel_ratio != 2))
-       {
-               job->height = job->maxHeight;
-               hb_fix_aspect( job, HB_KEEP_HEIGHT );
-               hb_log("Height out of bounds, scaling down to %i", job->maxHeight);
-               hb_log("New dimensions %i * %i", job->width, job->height);
-       }
-       if (job->maxWidth && (job->width > job->maxWidth) && (job->pixel_ratio != 2))
-       {
-               job->width = job->maxWidth;
-               hb_fix_aspect( job, HB_KEEP_WIDTH );
-               hb_log("Width out of bounds, scaling down to %i", job->maxWidth);
-               hb_log("New dimensions %i * %i", job->width, job->height);
-       }
+    /* Keep width and height within these boundaries,
+       but ignore for anamorphic. For "loose" anamorphic encodes,
+       this stuff is covered in the pixel_ratio section above.    */
+    if ( job->maxHeight && ( job->height > job->maxHeight ) && ( !job->pixel_ratio ) )
+    {
+        job->height = job->maxHeight;
+        hb_fix_aspect( job, HB_KEEP_HEIGHT );
+        hb_log( "Height out of bounds, scaling down to %i", job->maxHeight );
+        hb_log( "New dimensions %i * %i", job->width, job->height );
+    }
+    if ( job->maxWidth && ( job->width > job->maxWidth ) && ( !job->pixel_ratio ) )
+    {
+        job->width = job->maxWidth;
+        hb_fix_aspect( job, HB_KEEP_WIDTH );
+        hb_log( "Width out of bounds, scaling down to %i", job->maxWidth );
+        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 );
@@ -812,6 +794,12 @@ static void do_job( hb_job_t * job, int cpu_count )
     w->close( w );
     free( w );
 
+    hb_handle_t * h = job->h;
+    hb_state_t state;
+    hb_get_state( h, &state );
+    
+    hb_log("work: average encoding speed for job is %f fps", state.param.working.rate_avg);
+
 cleanup:
     /* Stop the write thread (thread_close will block until the muxer finishes) */
     if( job->muxer != NULL )