[vlc-devel] commit: Fix FLAC 7.1 support (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 13:24:05 2010 +0100| [86352fc87a075258c0343585ce36aa6f2018da29] | committer: Jean-Baptiste Kempf 

Fix FLAC 7.1 support

Close #3348

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

 modules/codec/flac.c      |   14 ++++++++++----
 modules/packetizer/flac.c |    2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index f35a1db..837b75f 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -64,7 +64,7 @@ struct decoder_sys_t
     bool b_stream_info;
 };
 
-static const int pi_channels_maps[7] =
+static const int pi_channels_maps[9] =
 {
     0,
     AOUT_CHAN_CENTER,
@@ -75,7 +75,13 @@ static const int pi_channels_maps[7] =
     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_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_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
+     | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
+     | AOUT_CHAN_LFE
 };
 
 /*****************************************************************************
@@ -334,8 +340,8 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
         { 0, 1, 3, 4, 2 },
         { 0, 1, 4, 5, 2, 3 },
 
-        { 0, 1, 6, 2, 3, 4, 5 },    /* 7.0 Unspecified by flac */
-        { 0, 1, 6, 7, 2, 3, 4, 5 }, /* 7.1 Unspecified by flac */
+        { 0, 1, 6, 4, 5, 2, 3 },    /* 7.0 Unspecified by flac, but following SMPTE */
+        { 0, 1, 6, 7, 4, 5, 2, 3 }, /* 7.1 Unspecified by flac, but following SMPTE */
     };
 
     VLC_UNUSED(decoder);
diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index a1a3c3b..e7c2c7e 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -206,7 +206,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
     if( !p_sys->b_stream_info )
         ProcessHeader( p_dec );
 
-    if( p_sys->stream_info.channels > 6 )
+    if( p_sys->stream_info.channels > 8 )
     {
         msg_Err( p_dec, "This stream uses too many audio channels" );
         return NULL;




More information about the vlc-devel mailing list