summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-02-16 01:13:09 +0000
committereddyg <[email protected]>2008-02-16 01:13:09 +0000
commitd6308581fa42b2c7503430c0fb8c3d9a828edb50 (patch)
tree2cd868f10e943bd612ebe21e2589322040eff83f /libhb/common.c
parent0b8c4601d56a6cc153d3543b782a975a0e725fc4 (diff)
Allow mac gui to select AC-3 + AAC at the same time, still needs CLI work for the same.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1267 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 5608abe6f..dab7fb48f 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -43,7 +43,10 @@ hb_mixdown_t hb_audio_mixdowns[] =
{ "Stereo", "HB_AMIXDOWN_STEREO", "stereo", HB_AMIXDOWN_STEREO },
{ "Dolby Surround", "HB_AMIXDOWN_DOLBY", "dpl1", HB_AMIXDOWN_DOLBY },
{ "Dolby Pro Logic II", "HB_AMIXDOWN_DOLBYPLII", "dpl2", HB_AMIXDOWN_DOLBYPLII },
- { "6-channel discrete", "HB_AMIXDOWN_6CH", "6ch", HB_AMIXDOWN_6CH } };
+ { "6-channel discrete", "HB_AMIXDOWN_6CH", "6ch", HB_AMIXDOWN_6CH },
+ { "AC-3 Pass-through", "HB_AMIXDOWN_AC3", "ac-3", HB_AMIXDOWN_AC3 },
+ { "Dolby PLII + AC-3", "HB_AMIXDOWN_DOLBYPLII_AC3", "dpl2+ac3", HB_AMIXDOWN_DOLBYPLII_AC3 },
+};
int hb_audio_mixdowns_count = sizeof( hb_audio_mixdowns ) /
sizeof( hb_mixdown_t );
@@ -224,13 +227,22 @@ int hb_calc_bitrate( hb_job_t * job, int size )
{
/* Audio data */
int abitrate;
- if( job->acodec & HB_ACODEC_AC3 )
+ if( job->acodec & HB_ACODEC_AC3 ||
+ job->audio_mixdowns[i] == HB_AMIXDOWN_AC3)
{
+ /*
+ * For AC-3 we take the bitrate from the input audio
+ * bitrate as we are simply passing it through.
+ */
audio = hb_list_item( title->list_audio, job->audios[i] );
abitrate = audio->bitrate / 8;
}
else
{
+ /*
+ * Where we are transcoding the audio we use the destination
+ * bitrate.
+ */
abitrate = job->abitrate * 1000 / 8;
}
avail -= length * abitrate;