[vlc-commits] Do not apply AOUT_CHAN_PHYSMASK to i_physical_channels

Rémi Denis-Courmont git at videolan.org
Sat Apr 21 18:23:50 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 21 18:52:48 2012 +0300| [f20299c236a7ff33dbe7beb2f90996efea4682d3] | committer: Rémi Denis-Courmont

Do not apply AOUT_CHAN_PHYSMASK to i_physical_channels

It only makes sense for i_original_channels.

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

 include/vlc_aout.h                            |    2 +-
 modules/audio_filter/converter/a52tofloat32.c |    5 ++---
 modules/audio_filter/converter/dtstofloat32.c |    5 ++---
 modules/codec/vorbis.c                        |    4 ++--
 src/audio_output/common.c                     |    2 +-
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 59de09e..9545fec 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -209,7 +209,7 @@ VLC_API void aout_ChannelExtract( void *p_dst, int i_dst_channels, const void *p
 /* */
 static inline unsigned aout_FormatNbChannels(const audio_sample_format_t *fmt)
 {
-    return popcount(fmt->i_physical_channels & AOUT_CHAN_PHYSMASK);
+    return popcount(fmt->i_physical_channels);
 }
 
 VLC_API unsigned int aout_BitsPerSample( vlc_fourcc_t i_format ) VLC_USED;
diff --git a/modules/audio_filter/converter/a52tofloat32.c b/modules/audio_filter/converter/a52tofloat32.c
index 5076061..0db610e 100644
--- a/modules/audio_filter/converter/a52tofloat32.c
+++ b/modules/audio_filter/converter/a52tofloat32.c
@@ -123,8 +123,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
 
     /* We'll do our own downmixing, thanks. */
     p_sys->i_nb_channels = aout_FormatNbChannels( output );
-    switch ( (output->i_physical_channels & AOUT_CHAN_PHYSMASK)
-              & ~AOUT_CHAN_LFE )
+    switch ( output->i_physical_channels & ~AOUT_CHAN_LFE )
     {
     case AOUT_CHAN_CENTER:
         if ( (output->i_original_channels & AOUT_CHAN_CENTER)
@@ -214,7 +213,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
     }
 
     aout_CheckChannelReorder( pi_channels_in, NULL,
-                              output->i_physical_channels & AOUT_CHAN_PHYSMASK,
+                              output->i_physical_channels,
                               p_sys->i_nb_channels,
                               p_sys->pi_chan_table );
 
diff --git a/modules/audio_filter/converter/dtstofloat32.c b/modules/audio_filter/converter/dtstofloat32.c
index 9f3fd02..9d7b70d 100644
--- a/modules/audio_filter/converter/dtstofloat32.c
+++ b/modules/audio_filter/converter/dtstofloat32.c
@@ -102,8 +102,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
 
     /* We'll do our own downmixing, thanks. */
     p_sys->i_nb_channels = aout_FormatNbChannels( output );
-    switch ( (output->i_physical_channels & AOUT_CHAN_PHYSMASK)
-              & ~AOUT_CHAN_LFE )
+    switch ( output->i_physical_channels & ~AOUT_CHAN_LFE )
     {
     case AOUT_CHAN_CENTER:
         if ( (output->i_original_channels & AOUT_CHAN_CENTER)
@@ -176,7 +175,7 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
     }
 
     aout_CheckChannelReorder( pi_channels_in, NULL,
-                              output->i_physical_channels & AOUT_CHAN_PHYSMASK,
+                              output->i_physical_channels,
                               p_sys->i_nb_channels,
                               p_sys->pi_chan_table );
 
diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
index 0af9219..c7e2b82 100644
--- a/modules/codec/vorbis.c
+++ b/modules/codec/vorbis.c
@@ -660,12 +660,12 @@ static void ConfigureChannelOrder(int *pi_chan_table, int i_channels, uint32_t i
 
     if( b_decode )
         aout_CheckChannelReorder( pi_channels_in, NULL,
-                                  i_channel_mask & AOUT_CHAN_PHYSMASK,
+                                  i_channel_mask,
                                   i_channels,
                                   pi_chan_table );
     else
         aout_CheckChannelReorder( NULL, pi_channels_in,
-                                  i_channel_mask & AOUT_CHAN_PHYSMASK,
+                                  i_channel_mask,
                                   i_channels,
                                   pi_chan_table );
 }
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index 8a9770f..0fe1088 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -300,7 +300,7 @@ void aout_FormatPrepare( audio_sample_format_t * p_format )
  *****************************************************************************/
 const char * aout_FormatPrintChannels( const audio_sample_format_t * p_format )
 {
-    switch ( p_format->i_physical_channels & AOUT_CHAN_PHYSMASK )
+    switch ( p_format->i_physical_channels )
     {
     case AOUT_CHAN_LEFT:
     case AOUT_CHAN_RIGHT:



More information about the vlc-commits mailing list