[vlc-devel] [RFC v2 1/2] audio: do not hardcode audio channel limits into the decoder/demuxer.
Emeric Grange
egrange at gopro.com
Mon Oct 12 18:02:37 CEST 2015
---
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 0746a5e..e473cfb 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 0473c73..dff33f5 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];
--
2.6.1
More information about the vlc-devel
mailing list