summaryrefslogtreecommitdiffstats
path: root/libhb/audio_remap.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-01-25 23:19:41 +0000
committerRodeo <[email protected]>2014-01-25 23:19:41 +0000
commitebf885ce8a75dd392e2acab9a8a0e29032e05f71 (patch)
tree14d6ac12639e501c963158497a485a16522519bd /libhb/audio_remap.c
parent90795a32478ff917df5a8b6a8bb817998d41ed58 (diff)
decavcodec: prefer AVFrame fields over their AVCodecContext equivalent.
These fields correspond to the actual audio data in the AVFrame, and should always be set (otherwise, we must submit a bug report to libav). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5994 b64f7644-9d1e-0410-96f1-a4d463321fa5
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,