diff options
author | Rodeo <[email protected]> | 2012-09-16 18:51:11 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-09-16 18:51:11 +0000 |
commit | 9fc704dc5bd063a805b2fa5025c574da9a06eec3 (patch) | |
tree | 9eefa718f393e970aeb88003c94a78f0c2121854 /libhb/deca52.c | |
parent | a8c6d0b29b66f87fd67a802f837c8966c7338ba6 (diff) |
deca52: ignore mix levels when dowmixing to Lt/Rt.
This matches liba52's built-in downmix code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4966 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/deca52.c')
-rw-r--r-- | libhb/deca52.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libhb/deca52.c b/libhb/deca52.c index 66e936dd2..2736d3f1c 100644 --- a/libhb/deca52.c +++ b/libhb/deca52.c @@ -37,6 +37,7 @@ struct hb_work_private_s uint8_t frame[3840]; int nchannels; + int use_mix_levels; uint64_t channel_layout; hb_audio_resample_t *resample; int *remap_table; @@ -148,6 +149,13 @@ static int deca52Init(hb_work_object_t *w, hb_job_t *job) hb_error("deca52Init: hb_audio_resample_init() failed"); return 1; } + + /* liba52 doesn't provide us with Lt/Rt mix levels. + * When doing an Lt/Rt downmix, ignore mix levels + * (this matches what liba52's own downmix code does). */ + pv->use_mix_levels = + !(audio->config.out.mixdown == HB_AMIXDOWN_DOLBY || + audio->config.out.mixdown == HB_AMIXDOWN_DOLBYPLII); } return 0; @@ -376,9 +384,12 @@ static hb_buffer_t* Decode(hb_work_object_t *w) hb_audio_resample_set_channel_layout(pv->resample, pv->channel_layout, pv->nchannels); - hb_audio_resample_set_mix_levels(pv->resample, - (double)pv->state->slev, - (double)pv->state->clev); + if (pv->use_mix_levels) + { + hb_audio_resample_set_mix_levels(pv->resample, + (double)pv->state->slev, + (double)pv->state->clev); + } if (hb_audio_resample_update(pv->resample)) { hb_log("deca52: hb_audio_resample_update() failed"); |