diff options
author | jstebbins <[email protected]> | 2010-10-04 23:16:57 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-04 23:16:57 +0000 |
commit | afffc15c0fec6680f6a612c729d184d92fbc809c (patch) | |
tree | 84266ecb82c48e371039feac8527f06573e57dc4 /libhb/common.c | |
parent | e10652943a245468659a3ed0dfed452ccd12ae0c (diff) |
Add ac3 encoding
Uses ffmpeg's ac3 encoder.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3570 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libhb/common.c b/libhb/common.c index 35417cb6c..0c9ac629e 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -34,7 +34,7 @@ hb_rate_t hb_audio_bitrates[] = { "64", 64 }, { "80", 80 }, { "96", 96 }, { "112", 112 }, { "128", 128 }, { "160", 160 }, { "192", 192 }, { "224", 224 }, { "256", 256 }, { "320", 320 }, { "384", 384 }, { "448", 448 }, - { "768", 768 } }; + { "512", 512 }, { "576", 576 }, { "640", 640 }, { "768", 768 } }; int hb_audio_bitrates_count = sizeof( hb_audio_bitrates ) / sizeof( hb_rate_t ); int hb_audio_bitrates_default = 8; /* 128 kbps */ @@ -255,6 +255,8 @@ int hb_calc_bitrate( hb_job_t * job, int size ) case HB_ACODEC_LAME: samples_per_frame = 1152; break; + case HB_ACODEC_AC3_PASS: + case HB_ACODEC_DCA_PASS: case HB_ACODEC_AC3: case HB_ACODEC_DCA: samples_per_frame = 1536; @@ -263,8 +265,8 @@ int hb_calc_bitrate( hb_job_t * job, int size ) return 0; } - if( audio->config.out.codec == HB_ACODEC_AC3 || - audio->config.out.codec == HB_ACODEC_DCA) + if( audio->config.out.codec == HB_ACODEC_AC3_PASS || + audio->config.out.codec == HB_ACODEC_DCA_PASS) { /* * For pass through we take the bitrate from the input audio @@ -904,7 +906,8 @@ 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; - if( audiocfg->out.codec == audio->config.in.codec ) + if( (audiocfg->out.codec & HB_ACODEC_MASK) == audio->config.in.codec && + (audiocfg->out.codec & HB_ACODEC_PASS_FLAG ) ) { /* Pass-through, copy from input. */ audio->config.out.samplerate = audio->config.in.samplerate; @@ -915,6 +918,7 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg) else { /* Non pass-through, use what is given. */ + audio->config.out.codec &= ~HB_ACODEC_PASS_FLAG; 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; |