[vlc-commits] fdkaac: set channel configuration
Rafaël Carré
git at videolan.org
Sat May 3 18:00:01 CEST 2014
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri May 2 12:32:12 2014 +0200| [c56a568542a11003cd6184404c9a66dabf0beb77] | committer: Rafaël Carré
fdkaac: set channel configuration
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c56a568542a11003cd6184404c9a66dabf0beb77
---
modules/codec/fdkaac.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/modules/codec/fdkaac.c b/modules/codec/fdkaac.c
index b8af7df..d4119f1 100644
--- a/modules/codec/fdkaac.c
+++ b/modules/codec/fdkaac.c
@@ -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 */
More information about the vlc-commits
mailing list