diff options
author | jstebbins <[email protected]> | 2011-09-27 15:58:35 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-09-27 15:58:35 +0000 |
commit | 9f28aa0119abc56ca61c68e896f2d7c61fdb7b80 (patch) | |
tree | 5aef14c9def88867c1b5768da6fed6653c7be684 /libhb | |
parent | 57f74136121d09a3583e5ed9c838dfab29ab8548 (diff) |
fix a crash in HandBrakeCLI
When the audio tracks are omitted (no -a), the cli uses the first source
audio track and replicates it for each audio output codec. The way it
knows what to replicate is to look at audio->in.track for the last audio
that was added to the job. This track number was being copied from the
title's in.track. But title track numbers are not guaranteed to be
sequential (e.g. scan drops tracks it can't decode). So when adding an
audio to a job, set in.track to the value of in.track that is passed in
the audio_config structure passed to hb_audio_add.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4260 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index 51a5139fe..01884f02b 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1358,6 +1358,12 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg) return 0; } + /* Set the job's "in track" to the value passed in audiocfg. + * HandBrakeCLI assumes this value is preserved in the jobs + * audio list, but in.track in the title's audio list is not + * required to be the same. */ + audio->config.in.track = audiocfg->in.track; + /* Really shouldn't ignore the passed out track, but there is currently no * way to handle duplicates or out-of-order track numbers. */ audio->config.out.track = hb_list_count(job->list_audio) + 1; |