summaryrefslogtreecommitdiffstats
path: root/libhb/audio_remap.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/audio_remap.c')
-rw-r--r--libhb/audio_remap.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/libhb/audio_remap.c b/libhb/audio_remap.c
index 44f0d73d3..d8c7f3de7 100644
--- a/libhb/audio_remap.c
+++ b/libhb/audio_remap.c
@@ -246,19 +246,25 @@ fail:
}
void hb_audio_remap_set_channel_layout(hb_audio_remap_t *remap,
- uint64_t channel_layout,
- int channels)
+ uint64_t channel_layout)
{
if (remap != NULL)
{
int ii;
remap->remap_needed = 0;
+ // sanitize the layout
+ if (channel_layout == AV_CH_LAYOUT_STEREO_DOWNMIX)
+ {
+ channel_layout = AV_CH_LAYOUT_STEREO;
+ }
+ remap->nchannels = av_get_channel_layout_nb_channels(channel_layout);
+
// in some cases, remapping is not necessary and/or supported
- if (channels > HB_AUDIO_REMAP_MAX_CHANNELS)
+ if (remap->nchannels > HB_AUDIO_REMAP_MAX_CHANNELS)
{
hb_log("hb_audio_remap_set_channel_layout: too many channels (%d)",
- channels);
+ remap->nchannels);
return;
}
if (remap->channel_map_in == remap->channel_map_out)
@@ -266,14 +272,6 @@ void hb_audio_remap_set_channel_layout(hb_audio_remap_t *remap,
return;
}
- // sanitize the layout
- channel_layout = hb_ff_layout_xlat(channel_layout, channels);
- if (channel_layout == AV_CH_LAYOUT_STEREO_DOWNMIX)
- {
- channel_layout = AV_CH_LAYOUT_STEREO;
- }
- remap->nchannels = av_get_channel_layout_nb_channels(channel_layout);
-
// build the table and check whether remapping is necessary
hb_audio_remap_build_table(remap->channel_map_out,
remap->channel_map_in, channel_layout,