[vlc-devel] [PATCH 10/12] demux: wav: supports inputs with channels > AOUT_CHAN_MAX

Thomas Guillem thomas at gllm.fr
Fri Jul 7 15:39:57 CEST 2017


If the channel number is higher than AOUT_CHAN_MAX, don't set the physical
mask, and just set the number of channels. A filter will take of dropping
extra channels or doing an ambisonics conversion.
---
 modules/demux/wav.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index db7a32c93c..5292d510f7 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -271,7 +271,8 @@ static int Open( vlc_object_t * p_this )
             }
         }
     }
-    if( p_sys->i_channel_mask == 0 && p_sys->fmt.audio.i_channels > 2 )
+    if( p_sys->i_channel_mask == 0 && p_sys->fmt.audio.i_channels > 2
+     && p_sys->fmt.audio.i_channels <= AOUT_CHAN_MAX )
     {
         /* A dwChannelMask of 0 tells the audio device to render the first
          * channel to the first port on the device, the second channel to the
@@ -554,8 +555,7 @@ static int FrameInfo_PCM( unsigned int *pi_size, int *pi_samples,
     int i_bytes;
 
     if( p_fmt->audio.i_rate > 352800
-     || p_fmt->audio.i_bitspersample > 64
-     || p_fmt->audio.i_channels > AOUT_CHAN_MAX )
+     || p_fmt->audio.i_bitspersample > 64 )
         return VLC_EGENERIC;
 
     /* read samples for 50ms of */
-- 
2.11.0



More information about the vlc-devel mailing list