summaryrefslogtreecommitdiffstats
path: root/libhb/encfaac.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-07-12 20:13:23 +0000
committerRodeo <[email protected]>2012-07-12 20:13:23 +0000
commit252b183a32348050bbf9c23f3d70e9723db9271a (patch)
treec7a204fbdfd3c3413c788445cfad05c7a7344fc6 /libhb/encfaac.c
parentf0c657025d394b1224abc6184bfea1540c9b9b16 (diff)
hb_audio_remap improvements.
This moves some logic outside of the decoders/encoders and into a single place. Encoders that do their own remapping (faac, vorbis) can still generate a remap table with hb_audio_remap_build_table(), without having to use hb_audio_remap(). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4827 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encfaac.c')
-rw-r--r--libhb/encfaac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libhb/encfaac.c b/libhb/encfaac.c
index 6782605e9..675881e8e 100644
--- a/libhb/encfaac.c
+++ b/libhb/encfaac.c
@@ -110,20 +110,20 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
cfg->aacObjectType = LOW;
cfg->allowMidside = 1;
- // LFE, remapping
+ // channel remapping, LFE
uint64_t layout;
+ int *remap_table;
layout = hb_ff_mixdown_xlat(audio->config.out.mixdown, NULL);
- cfg->useLfe = !!(layout & AV_CH_LOW_FREQUENCY);
- if (pv->out_discrete_channels > 2 &&
- audio->config.in.channel_map != &hb_aac_chan_map)
+ remap_table = hb_audio_remap_build_table(layout, &hb_aac_chan_map,
+ audio->config.in.channel_map);
+ if (remap_table != NULL)
{
- int *remap_table;
- remap_table = hb_audio_remap_build_table(layout,
- audio->config.in.channel_map,
- &hb_aac_chan_map);
// faac does its own remapping
- memcpy(cfg->channel_map, remap_table, pv->out_discrete_channels * sizeof(int));
+ memcpy(cfg->channel_map, remap_table,
+ pv->out_discrete_channels * sizeof(int));
+ free(remap_table);
}
+ cfg->useLfe = !!(layout & AV_CH_LOW_FREQUENCY);
cfg->useTns = 0;
cfg->bitRate = audio->config.out.bitrate * 1000 / pv->out_discrete_channels; /* Per channel */