summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-02-18 22:57:44 +0000
committereddyg <[email protected]>2008-02-18 22:57:44 +0000
commitc5da5eb897dc47dc8ae22a5af4f9c6669f6b5259 (patch)
tree9ebdf9600bf13839da7a42e63da2800263c62fe9 /libhb
parent00cb00b5d1b8d5e704b03425d6f16f506cce61e4 (diff)
Sanity check the input codec is AC3 when selecting AC3 pass through to avoid crash when it is mpega or lpcm etc.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1290 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/work.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 51cbe5ed4..04a5062f4 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -397,6 +397,15 @@ static void do_job( hb_job_t * job, int cpu_count )
int audioCodecsSupport6Ch = ((audio->codec == HB_ACODEC_AC3 ||
audio->codec == HB_ACODEC_DCA) && (job->acodec == HB_ACODEC_FAAC || job->acodec == HB_ACODEC_VORBIS));
+ if( audio->codec != HB_ACODEC_AC3 && job->audio_mixdowns[i] == HB_AMIXDOWN_AC3 )
+ {
+ /*
+ * Sanity check that we haven't asked for AC3 from a non AC3 track - drop this track
+ * to stereo to avoid a crash later.
+ */
+ job->audio_mixdowns[i] = HB_AMIXDOWN_STEREO;
+ }
+
if( job->audio_mixdowns[i] != HB_AMIXDOWN_AC3 )
{
/* find out what the format of our source audio is */