From: eddyg Date: Thu, 17 Apr 2008 00:22:14 +0000 (+0000) Subject: Avoid a divide by 0 in encfaac.c caused by the mixdown not being specified X-Git-Tag: 0.9.3~521 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b67ac13f0094118d8570b95723a77a780ea2a5e;p=handbrake Avoid a divide by 0 in encfaac.c caused by the mixdown not being specified 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://svn.handbrake.fr/HandBrake/trunk@1423 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/work.c b/libhb/work.c index 0632fde07..6efe796db 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -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) &&