OSDN Git Service

Avoid a divide by 0 in encfaac.c caused by the mixdown not being specified
authoreddyg <eddyg@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 17 Apr 2008 00:22:14 +0000 (00:22 +0000)
committereddyg <eddyg@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 17 Apr 2008 00:22:14 +0000 (00:22 +0000)
for AAC tracks (due toi a bug in HandBrake.app). Ensure that a mixdown
is always specified if not doing passthrough.

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

libhb/work.c

index 0632fde..6efe796 100644 (file)
@@ -411,6 +411,15 @@ static void do_job( hb_job_t * job, int cpu_count )
 
         /* sense-check the requested mixdown */
 
+                if( audio->config.out.mixdown == 0 && audio->config.out.codec != HB_ACODEC_AC3 )
+                {
+                    /*
+                     * Mixdown wasn't specified and this is not pass-through, set a default mixdown
+                     * of stereo.
+                     */
+                    audio->config.out.mixdown = HB_AMIXDOWN_STEREO;
+                }
+
         /* audioCodecsSupportMono and audioCodecsSupport6Ch are the same for now,
            but this may change in the future, so they are separated for flexibility */
         int audioCodecsSupportMono = ( (audio->config.in.codec == HB_ACODEC_AC3 || audio->config.in.codec == HB_ACODEC_DCA) &&