]> granicus.if.org Git - handbrake/commitdiff
Updated do_job() in work.c to remove any non-AC3 audio tracks from the job before...
authormaurj <handbrake@maurj.com>
Fri, 4 May 2007 20:25:54 +0000 (20:25 +0000)
committermaurj <handbrake@maurj.com>
Fri, 4 May 2007 20:25:54 +0000 (20:25 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@569 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/work.c

index e45ee7bab0823787c7dbdfcc08ab293d32766a36..7cdb09fccd320d91b61ac7577ae8b8f5e23a9a24 100644 (file)
@@ -216,6 +216,20 @@ static void do_job( hb_job_t * job, int cpu_count )
                 "vorbis" ) );
     }
 
+    /* if we are doing AC3 passthru, then remove any non-AC3 audios from the job */
+    /* otherwise, Bad Things will happen */
+    for( i = 0; i < hb_list_count( title->list_audio ); )
+    {
+        audio = hb_list_item( title->list_audio, i );
+        if( ( job->acodec & HB_ACODEC_AC3 ) && ( audio->codec != HB_ACODEC_AC3 ) )
+        {
+            hb_list_rem( title->list_audio, audio );
+            free( audio );
+            continue;
+        }
+        i++;
+    }
+
     for( i = 0; i < hb_list_count( title->list_audio ); i++ )
     {
         audio = hb_list_item( title->list_audio, i );