Commit 18a7aaca authored by Emeric Grange's avatar Emeric Grange Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d03be6c0
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment