Commit 989a7bdb authored by Boris Dorès's avatar Boris Dorès

- accurate testing of i_original_channels

parent 4bcde574
......@@ -81,13 +81,11 @@ static int Create( vlc_object_t *p_this )
aout_filter_t * p_filter = (aout_filter_t *)p_this;
/* Validate audio filter format */
if ( p_filter->input.i_original_channels
!= (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT|AOUT_CHAN_DOLBYSTEREO )
if ( p_filter->input.i_physical_channels != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
|| ! ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
|| aout_FormatNbChannels( &p_filter->output ) <= 2
|| p_filter->output.i_physical_channels
!= ( p_filter->output.i_original_channels & AOUT_CHAN_PHYSMASK )
|| p_filter->input.i_physical_channels
!= ( p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK ))
|| ( p_filter->input.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO )
!= ( p_filter->output.i_original_channels & ~AOUT_CHAN_DOLBYSTEREO ) )
{
return VLC_EGENERIC;
}
......
......@@ -344,17 +344,21 @@ static int Create( vlc_object_t *p_this )
vlc_bool_t b_fit = VLC_TRUE;
/* Activate this filter only with stereo devices */
if ( p_filter->output.i_physical_channels != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
|| p_filter->output.i_physical_channels
!= ( p_filter->output.i_original_channels & AOUT_CHAN_PHYSMASK )
|| p_filter->input.i_physical_channels
!= ( p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK ) )
if ( p_filter->output.i_physical_channels
!= (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
{
msg_Dbg( p_filter, "Filter discarded (incompatible format)" );
return VLC_EGENERIC;
}
/* Request a specific format if not already compatible */
if ( p_filter->input.i_original_channels
!= p_filter->output.i_original_channels )
{
b_fit = VLC_FALSE;
p_filter->input.i_original_channels =
p_filter->output.i_original_channels;
}
if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
|| p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
{
......@@ -376,7 +380,6 @@ static int Create( vlc_object_t *p_this )
AOUT_CHAN_CENTER |
AOUT_CHAN_REARLEFT |
AOUT_CHAN_REARRIGHT;
p_filter->input.i_original_channels = p_filter->input.i_physical_channels;
}
if ( ! b_fit )
{
......
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