[vlc-commits] transcode: add more channels on audio
Ilkka Ollakka
git at videolan.org
Thu Mar 6 16:14:46 CET 2014
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Mar 2 13:07:44 2014 +0200| [7962989c128e76e53e393259fb0b81eefc3496f6] | committer: Ilkka Ollakka
transcode: add more channels on audio
Assume that 3 channels is 2.1 instead of 3 front channels,
also 6 is 5.1.
Ref #1897
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7962989c128e76e53e393259fb0b81eefc3496f6
---
modules/stream_out/transcode/audio.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index e298873..8a66ab0 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -35,15 +35,24 @@
#include <vlc_meta.h>
#include <vlc_modules.h>
-static const int pi_channels_maps[6] =
+static const int pi_channels_maps[9] =
{
0,
- AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
- AOUT_CHAN_CENTER | AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+ AOUT_CHAN_CENTER,
+ AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+ AOUT_CHAN_LFE | AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_REARLEFT
| AOUT_CHAN_REARRIGHT,
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
- | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
+ | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
+ 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_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,
};
static int audio_update_format( decoder_t *p_dec )
@@ -114,7 +123,7 @@ static int transcode_audio_initialize_encoder( sout_stream_id_sys_t *id, sout_st
if( !id->p_encoder->fmt_in.audio.i_physical_channels
|| !id->p_encoder->fmt_in.audio.i_original_channels )
{
- if( id->p_encoder->fmt_in.audio.i_channels < 6 )
+ if( id->p_encoder->fmt_in.audio.i_channels < (sizeof(pi_channels_maps) / sizeof(*pi_channels_maps)) )
id->p_encoder->fmt_in.audio.i_physical_channels =
id->p_encoder->fmt_in.audio.i_original_channels =
pi_channels_maps[id->p_encoder->fmt_in.audio.i_channels];
More information about the vlc-commits
mailing list