[vlc-devel] commit: Fixed wav audio channel order. (Laurent Aimar )

git version control git at videolan.org
Wed Apr 1 07:47:13 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Mar 31 19:40:48 2009 +0200| [0db2b22536e17b3761cb845b460e468d8bb15305] | committer: Laurent Aimar 

Fixed wav audio channel order.

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

 modules/demux/wav.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index 9e40f73..e411644 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -202,25 +202,33 @@ static int Open( vlc_object_t * p_this )
                 if( i_channel_mask & pi_channels_src[i] )
                     p_sys->i_channel_mask |= pi_channels_in[i];
             }
+        }
+    }
+    else if( GetWLE( &p_wf->wFormatTag ) == WAVE_FORMAT_PCM &&
+             p_sys->fmt.audio.i_channels > 2 && p_sys->fmt.audio.i_channels <= 9 )
+    {
+        for( int i = 0; i < p_sys->fmt.audio.i_channels; i++ )
+            p_sys->i_channel_mask |= pi_channels_in[i];
+    }
 
-            if( p_sys->fmt.i_codec == VLC_FOURCC('a','r','a','w') ||
-                p_sys->fmt.i_codec == VLC_FOURCC('p','c','m',' ') ||
-                p_sys->fmt.i_codec == VLC_FOURCC('a','f','l','t') )
-
+    if( p_sys->i_channel_mask )
+    {
+        if( p_sys->fmt.i_codec == VLC_FOURCC('a','r','a','w') ||
+            p_sys->fmt.i_codec == VLC_FOURCC('p','c','m',' ') ||
+            p_sys->fmt.i_codec == VLC_FOURCC('a','f','l','t') )
             p_sys->b_chan_reorder =
                 aout_CheckChannelReorder( pi_channels_in, NULL,
                                           p_sys->i_channel_mask,
                                           p_sys->fmt.audio.i_channels,
                                           p_sys->pi_chan_table );
 
-            msg_Dbg( p_demux, "channel mask: %x, reordering: %i",
-                     p_sys->i_channel_mask, (int)p_sys->b_chan_reorder );
-        }
-        p_sys->fmt.audio.i_physical_channels =
-            p_sys->fmt.audio.i_original_channels =
-                p_sys->i_channel_mask;
+        msg_Dbg( p_demux, "channel mask: %x, reordering: %i",
+                 p_sys->i_channel_mask, (int)p_sys->b_chan_reorder );
     }
 
+    p_sys->fmt.audio.i_physical_channels =
+    p_sys->fmt.audio.i_original_channels = p_sys->i_channel_mask;
+
     if( p_sys->fmt.i_extra > 0 )
     {
         p_sys->fmt.p_extra = malloc( p_sys->fmt.i_extra );




More information about the vlc-devel mailing list