Commit 4ddfcff3 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Vorbis: support for 6.1 and 7.1

Close #3347
parent 86352fc8
...@@ -99,17 +99,29 @@ static const int pi_channels_maps[9] = ...@@ -99,17 +99,29 @@ static const int pi_channels_maps[9] =
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE, | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_REARCENTER | AOUT_CHAN_MIDDLELEFT
| AOUT_CHAN_MIDDLERIGHT, | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE,
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
| AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT | 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 */ /* recommended vorbis channel order for 6 channels */
static const uint32_t pi_6channels_in[] = static const uint32_t pi_6channels_in[] =
{ AOUT_CHAN_LEFT, AOUT_CHAN_CENTER, AOUT_CHAN_RIGHT, { 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 ...@@ -612,6 +624,12 @@ static void ConfigureChannelOrder(int *pi_chan_table, int i_channels, uint32_t i
const uint32_t *pi_channels_in; const uint32_t *pi_channels_in;
switch( i_channels ) switch( i_channels )
{ {
case 8:
pi_channels_in = pi_8channels_in;
break;
case 7:
pi_channels_in = pi_7channels_in;
break;
case 6: case 6:
case 5: case 5:
pi_channels_in = pi_6channels_in; pi_channels_in = pi_6channels_in;
......
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