/*****************************************************************************
* aout_DecNew : create a decoder
*****************************************************************************/
-static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
+static aout_input_t * DecNew( aout_instance_t * p_aout,
audio_sample_format_t *p_format,
const audio_replay_gain_t *p_replay_gain,
const aout_request_vout_t *p_request_vout )
msg_Err( p_aout, "no audio channels" );
return NULL;
}
+ if( p_format->i_channels != aout_FormatNbChannels( p_format ) )
+ {
+ msg_Err( p_aout, "incompatible audio channels count with layout mask" );
+ return NULL;
+ }
if( p_format->i_rate > 192000 )
{
p_aout->pp_inputs[p_aout->i_nb_inputs] = p_input;
p_aout->i_nb_inputs++;
- if ( p_aout->mixer.b_error )
+ if ( !p_aout->p_mixer )
{
int i;
*pp_aout = p_aout;
}
- return DecNew( p_this, p_aout, p_format, p_replay_gain, p_request_video );
+ return DecNew( p_aout, p_format, p_replay_gain, p_request_video );
}
/*****************************************************************************
{
aout_OutputDelete( p_aout );
aout_MixerDelete( p_aout );
- if ( var_Type( p_aout, "audio-device" ) != 0 )
- {
- var_Destroy( p_aout, "audio-device" );
- }
- if ( var_Type( p_aout, "audio-channels" ) != 0 )
- {
- var_Destroy( p_aout, "audio-channels" );
- }
+ var_Destroy( p_aout, "audio-device" );
+ var_Destroy( p_aout, "audio-channels" );
}
aout_unlock_mixer( p_aout );
if( i_duration != 0 )
{
aout_lock_mixer( p_aout );
- for( aout_buffer_t *p = p_input->fifo.p_first; p != NULL; p = p->p_next )
+ for( aout_buffer_t *p = p_input->mixer.fifo.p_first; p != NULL; p = p->p_next )
{
p->start_date += i_duration;
p->end_date += i_duration;
{
aout_lock_input_fifos( p_aout );
- aout_FifoSet( p_aout, &p_input->fifo, 0 );
- p_input->p_first_byte_to_mix = NULL;
+ aout_FifoSet( p_aout, &p_input->mixer.fifo, 0 );
+ p_input->mixer.begin = NULL;
aout_unlock_input_fifos( p_aout );
}