[vlc-devel] commit: Allow up to 8 channels with ffmpeg decoder. (Laurent Aimar )

git version control git at videolan.org
Sat Nov 29 10:53:18 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Nov 28 19:40:35 2008 +0100| [1f8490d6324f60ed3fbe827ac936a7341528ac8b] | committer: Laurent Aimar 

Allow up to 8 channels with ffmpeg decoder.

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

 modules/codec/avcodec/audio.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index bff0f99..ba13919 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -44,17 +44,23 @@
 
 #include "avcodec.h"
 
-static const unsigned int pi_channels_maps[7] =
+static const unsigned 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_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_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE
+    AOUT_CHAN_CENTER,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER,
+    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_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_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
+        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
+    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER |
+        AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT |
+        AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
 };
 
 /*****************************************************************************
@@ -321,7 +327,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
     p_block->i_buffer -= i_used;
     p_block->p_buffer += i_used;
 
-    if( p_sys->p_context->channels <= 0 || p_sys->p_context->channels > 6 ||
+    if( p_sys->p_context->channels <= 0 || p_sys->p_context->channels > 8 ||
         p_sys->p_context->sample_rate <= 0 )
     {
         msg_Warn( p_dec, "invalid audio properties channels count %d, sample rate %d",




More information about the vlc-devel mailing list