summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2008-06-17 20:38:08 +0000
committersaintdev <[email protected]>2008-06-17 20:38:08 +0000
commit1b5ac1af5a9e794ce6e484154a638c0fb2144ad3 (patch)
tree6a6bf459ae541679a09f403809a24b76731e3793 /libhb
parent7cd8e24ed2be86b90e70e869c07ad21a1fbcdcaa (diff)
If we're using pass-through, copy the input bitrate/sample rate to the output.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1520 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libhb/common.c b/libhb/common.c
index bd183e9f9..457ef894f 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -730,10 +730,22 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg)
*/
audio->config.out.track = hb_list_count(job->list_audio) + 1;
audio->config.out.codec = audiocfg->out.codec;
- audio->config.out.samplerate = audiocfg->out.samplerate;
- audio->config.out.bitrate = audiocfg->out.bitrate;
- audio->config.out.mixdown = audiocfg->out.mixdown;
- audio->config.out.dynamic_range_compression = audiocfg->out.dynamic_range_compression;
+ if( audiocfg->out.codec == audio->config.in.codec )
+ {
+ /* Pass-through, copy from input. */
+ audio->config.out.samplerate = audio->config.in.samplerate;
+ audio->config.out.bitrate = audio->config.in.bitrate;
+ audio->config.out.dynamic_range_compression = 0;
+ audio->config.out.mixdown = 0;
+ }
+ else
+ {
+ /* Non pass-through, use what is given. */
+ audio->config.out.samplerate = audiocfg->out.samplerate;
+ audio->config.out.bitrate = audiocfg->out.bitrate;
+ audio->config.out.dynamic_range_compression = audiocfg->out.dynamic_range_compression;
+ audio->config.out.mixdown = audiocfg->out.mixdown;
+ }
hb_list_add(job->list_audio, audio);
return 1;