[vlc-commits] Audio: do not hardcode audio channel limits into the decoder/demuxer

Emeric Grange git at videolan.org
Thu Nov 26 18:23:22 CET 2015


vlc | branch: master | Emeric Grange <egrange at gopro.com> | Mon Oct 12 18:02:37 2015 +0200| [18a7aaca6ec60f35912da4e8015bc648738004d3] | committer: Jean-Baptiste Kempf

Audio: do not hardcode audio channel limits into the decoder/demuxer

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/araw.c |    4 ++--
 modules/codec/g711.c |    4 ++--
 modules/demux/wav.c  |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index 54db33b..85cec83 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -246,8 +246,8 @@ static int DecoderOpen( vlc_object_t *p_this )
     if( p_dec->fmt_in.audio.i_channels <= 0 ||
         p_dec->fmt_in.audio.i_channels > AOUT_CHAN_MAX )
     {
-        msg_Err( p_dec, "bad channels count (1-9): %i",
-                 p_dec->fmt_in.audio.i_channels );
+        msg_Err( p_dec, "bad channels count (1-%i): %i",
+                 AOUT_CHAN_MAX, p_dec->fmt_in.audio.i_channels );
         return VLC_EGENERIC;
     }
 
diff --git a/modules/codec/g711.c b/modules/codec/g711.c
index c5540b1..119c36a 100644
--- a/modules/codec/g711.c
+++ b/modules/codec/g711.c
@@ -162,8 +162,8 @@ static int DecoderOpen( vlc_object_t *p_this )
     if( p_dec->fmt_in.audio.i_channels <= 0 ||
         p_dec->fmt_in.audio.i_channels > AOUT_CHAN_MAX )
     {
-        msg_Err( p_dec, "bad channels count (1-9): %i",
-                 p_dec->fmt_in.audio.i_channels );
+        msg_Err( p_dec, "bad channels count (1-%i): %i",
+                 AOUT_CHAN_MAX, p_dec->fmt_in.audio.i_channels );
         return VLC_EGENERIC;
     }
 
diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index 827bf72..5a0fe79 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -272,7 +272,7 @@ static int Open( vlc_object_t * p_this )
         }
     }
     else if( GetWLE( &p_wf->wFormatTag ) == WAVE_FORMAT_PCM &&
-             p_sys->fmt.audio.i_channels > 2 && p_sys->fmt.audio.i_channels <= 9 )
+             p_sys->fmt.audio.i_channels > 2 && p_sys->fmt.audio.i_channels <= AOUT_CHAN_MAX )
     {
         for( int i = 0; i < p_sys->fmt.audio.i_channels; i++ )
             p_sys->i_channel_mask |= pi_channels_aout[i];



More information about the vlc-commits mailing list