diff options
author | Rodeo <[email protected]> | 2012-06-06 16:07:58 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-06-06 16:07:58 +0000 |
commit | 72c8cf5206c9023be572b0dbc5d13b81089a7a29 (patch) | |
tree | 16fba17678ebd31aaae6691323218be06277fa16 /libhb/deca52.c | |
parent | 20bdd49d52b0412764ac6a2e20f0a3c3689cd409 (diff) |
Make HB_AMIXDOWN_* defines a simple enumeration. The existing system wasn't necessary and didn't work in all decoders for Dolby downmixing.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4714 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/deca52.c')
-rw-r--r-- | libhb/deca52.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/libhb/deca52.c b/libhb/deca52.c index f0befdd01..049281fb5 100644 --- a/libhb/deca52.c +++ b/libhb/deca52.c @@ -97,18 +97,36 @@ static int deca52Init( hb_work_object_t * w, hb_job_t * job ) pv->crc_table = av_crc_get_table( AV_CRC_16_ANSI ); pv->list = hb_list_init(); pv->state = a52_init( 0 ); + pv->level = 1.0; + pv->dynamic_range_compression = audio->config.out.dynamic_range_compression; - /* Decide what format we want out of a52dec - work.c has already done some of this deduction for us in do_job() */ + /* Decide what format we want out of a52dec; + * work.c has already done some of this deduction for us in do_job(). */ + switch( audio->config.out.mixdown ) + { + case HB_AMIXDOWN_6CH: + pv->flags_out = ( A52_3F2R | A52_LFE ); + break; - pv->flags_out = HB_AMIXDOWN_GET_A52_FORMAT(audio->config.out.mixdown); + case HB_AMIXDOWN_DOLBYPLII: + pv->flags_out = ( A52_DOLBY | A52_USE_DPLII ); + break; - /* pass the number of channels used into the private work data */ - /* will only be actually used if we're not doing AC3 passthru */ - pv->out_discrete_channels = HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->config.out.mixdown); + case HB_AMIXDOWN_DOLBY: + pv->flags_out = A52_DOLBY; + break; - pv->level = 1.0; - pv->dynamic_range_compression = audio->config.out.dynamic_range_compression; + case HB_AMIXDOWN_MONO: + pv->flags_out = A52_MONO; + break; + + default: + pv->flags_out = A52_STEREO; + break; + } + + /* pass the number of channels used into the private work data */ + pv->out_discrete_channels = hb_mixdown_get_discrete_channel_count( audio->config.out.mixdown ); return 0; } |