Commit c56a5685 authored by Rafaël Carré's avatar Rafaël Carré

fdkaac: set channel configuration

parent f53e858b
......@@ -221,20 +221,30 @@ static int OpenEncoder( vlc_object_t *p_this )
i_profile = PROFILE_AAC_HE_v2;
}
uint16_t channel_config;
switch (p_enc->fmt_in.audio.i_channels) {
case 1: mode = MODE_1; sce = 1; cpe = 0; break;
case 2: mode = MODE_2; sce = 0; cpe = 1; break;
case 3: mode = MODE_1_2; sce = 1; cpe = 1; break;
case 4: mode = MODE_1_2_1; sce = 2; cpe = 1; break;
case 5: mode = MODE_1_2_2; sce = 1; cpe = 2; break;
case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break;
case 8: mode = MODE_1_2_2_2_1; sce = 2; cpe = 3; break;
case 1: mode = MODE_1; sce = 1; cpe = 0;
channel_config = AOUT_CHAN_CENTER; break;
case 2: mode = MODE_2; sce = 0; cpe = 1;
channel_config = AOUT_CHANS_STEREO; break;
case 3: mode = MODE_1_2; sce = 1; cpe = 1;
channel_config = AOUT_CHANS_3_0; break;
case 4: mode = MODE_1_2_1; sce = 2; cpe = 1;
channel_config = AOUT_CHANS_4_CENTER_REAR; break;
case 5: mode = MODE_1_2_2; sce = 1; cpe = 2;
channel_config = AOUT_CHANS_5_0; break;
case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2;
channel_config = AOUT_CHANS_5_1; break;
case 8: mode = MODE_1_2_2_2_1; sce = 2; cpe = 3;
channel_config = AOUT_CHANS_7_1; break;
default:
msg_Err( p_enc, "we do not support > 8 input channels, this input has %i",
p_enc->fmt_in.audio.i_channels );
return VLC_EGENERIC;
}
p_enc->fmt_in.audio.i_physical_channels = channel_config;
msg_Info(p_enc, "Initializing AAC Encoder, %i channels", p_enc->fmt_in.audio.i_channels);
/* Allocate the memory needed to store the encoder's structure */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment