[vlc-devel] commit: Vorbis: support for 6.1 and 7.1 (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Feb 26 21:02:52 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Feb 26 14:26:55 2010 +0100| [4ddfcff3a2b18c7ae08f39511224782d443925aa] | committer: Jean-Baptiste Kempf 

Vorbis: support for 6.1 and 7.1

Close #3347

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ddfcff3a2b18c7ae08f39511224782d443925aa
---

 modules/codec/vorbis.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
index cfaebf3..4d1eaa4 100644
--- a/modules/codec/vorbis.c
+++ b/modules/codec/vorbis.c
@@ -99,17 +99,29 @@ static const int pi_channels_maps[9] =
     AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
      | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
     AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
-     | AOUT_CHAN_MIDDLERIGHT,
+     | AOUT_CHAN_REARCENTER | AOUT_CHAN_MIDDLELEFT
+     | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE,
     AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
      | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
-     | AOUT_CHAN_LFE
+     | AOUT_CHAN_LFE,
 };
 
 /*
-**  channel order as defined in http://www.ogghelp.com/ogg/glossary.cfm#Audio_Channels
+**  channel order as defined in http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9
 */
 
+/* recommended vorbis channel order for 8 channels */
+static const uint32_t pi_8channels_in[] =
+{ AOUT_CHAN_LEFT, AOUT_CHAN_CENTER, AOUT_CHAN_RIGHT,
+  AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
+  AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,AOUT_CHAN_LFE,0 };
+
+/* recommended vorbis channel order for 7 channels */
+static const uint32_t pi_7channels_in[] =
+{ AOUT_CHAN_LEFT, AOUT_CHAN_CENTER, AOUT_CHAN_RIGHT,
+  AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
+  AOUT_CHAN_REARCENTER,AOUT_CHAN_LFE,0 };
+
 /* recommended vorbis channel order for 6 channels */
 static const uint32_t pi_6channels_in[] =
 { AOUT_CHAN_LEFT, AOUT_CHAN_CENTER, AOUT_CHAN_RIGHT,
@@ -612,6 +624,12 @@ static void ConfigureChannelOrder(int *pi_chan_table, int i_channels, uint32_t i
     const uint32_t *pi_channels_in;
     switch( i_channels )
     {
+        case 8:
+            pi_channels_in = pi_8channels_in;
+            break;
+        case 7:
+            pi_channels_in = pi_7channels_in;
+            break;
         case 6:
         case 5:
             pi_channels_in = pi_6channels_in;




More information about the vlc-devel mailing list