[vlc-commits] Use pi_vlc_chan_order_wg4

Rémi Denis-Courmont git at videolan.org
Mon Aug 6 22:27:21 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug  6 23:26:49 2012 +0300| [9fef3403af75af8c31f88677ab09357a70340feb] | committer: Rémi Denis-Courmont

Use pi_vlc_chan_order_wg4

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

 modules/audio_output/directx.c              |    6 ++----
 modules/audio_output/waveout.c              |    6 ++----
 modules/audio_output/windows_audio_common.h |    5 -----
 modules/mux/wav.c                           |   14 ++------------
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c
index b4fb067..964af38 100644
--- a/modules/audio_output/directx.c
+++ b/modules/audio_output/directx.c
@@ -820,11 +820,9 @@ static int CreateDSBuffer( audio_output_t *p_aout, int i_format,
 
     /* First set the sound buffer format */
     waveformat.dwChannelMask = 0;
-    for( i = 0; i < sizeof(pi_channels_src)/sizeof(uint32_t); i++ )
-    {
-        if( i_channels & pi_channels_src[i] )
+    for( unsigned i = 0; pi_vlc_chan_order_wg4[i]; i++ )
+        if( i_channels & pi_vlc_chan_order_wg4[i] )
             waveformat.dwChannelMask |= pi_channels_in[i];
-    }
 
     switch( i_format )
     {
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 4135d9e..dc355cd 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -603,11 +603,9 @@ static int OpenWaveOut( audio_output_t *p_aout, uint32_t i_device_id, int i_form
 #define waveformat p_aout->sys->waveformat
 
     waveformat.dwChannelMask = 0;
-    for( unsigned i = 0; i < sizeof(pi_channels_src)/sizeof(uint32_t); i++ )
-    {
-        if( i_channels & pi_channels_src[i] )
+    for( unsigned i = 0; pi_vlc_chan_order_wg4[i]; i++ )
+        if( i_channels & pi_vlc_chan_order_wg4[i] )
             waveformat.dwChannelMask |= pi_channels_in[i];
-    }
 
     switch( i_format )
     {
diff --git a/modules/audio_output/windows_audio_common.h b/modules/audio_output/windows_audio_common.h
index 4003778..c8589ec 100644
--- a/modules/audio_output/windows_audio_common.h
+++ b/modules/audio_output/windows_audio_common.h
@@ -128,11 +128,6 @@ typedef struct {
 #   define DSSPEAKER_7POINT1_WIDE           DSSPEAKER_7POINT1
 #endif
 
-static const uint32_t pi_channels_src[] =
-    { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
-      AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
-      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
-      AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0 };
 static const uint32_t pi_channels_in[] =
     { SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT,
       SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT,
diff --git a/modules/mux/wav.c b/modules/mux/wav.c
index 6c43264..db70f7c 100644
--- a/modules/mux/wav.c
+++ b/modules/mux/wav.c
@@ -79,12 +79,6 @@ struct sout_mux_sys_t
     int pi_chan_table[AOUT_CHAN_MAX];
 };
 
-
-static const uint32_t pi_channels_src[] =
-    { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
-      AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
-      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
-      AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0 };
 static const uint32_t pi_channels_in[] =
     { WAVE_SPEAKER_FRONT_LEFT, WAVE_SPEAKER_FRONT_RIGHT,
       WAVE_SPEAKER_SIDE_LEFT, WAVE_SPEAKER_SIDE_RIGHT,
@@ -187,13 +181,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     p_sys->i_channel_mask = 0;
     if( p_input->p_fmt->audio.i_physical_channels )
     {
-        unsigned int i;
- 
-        for( i = 0; i < sizeof(pi_channels_in)/sizeof(uint32_t); i++ )
-        {
-            if( p_input->p_fmt->audio.i_physical_channels & pi_channels_src[i])
+        for( unsigned i = 0; i < pi_vlc_chan_order_wg4[i]; i++ )
+            if( p_input->p_fmt->audio.i_physical_channels & pi_vlc_chan_order_wg4[i])
                 p_sys->i_channel_mask |= pi_channels_in[i];
-        }
 
         p_sys->b_chan_reorder =
             aout_CheckChannelReorder( pi_channels_in, pi_channels_out,



More information about the vlc-commits mailing list