static inline void aout_assert_fifo_locked( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
#ifndef NDEBUG
+ if( !p_aout )
+ return;
+
if( p_fifo == &p_aout->output.fifo )
vlc_assert_locked( &p_aout->output_fifo_lock );
else
int i;
for( i = 0; i < p_aout->i_nb_inputs; i++ )
{
- if( p_fifo == &p_aout->pp_inputs[i]->fifo)
+ if( p_fifo == &p_aout->pp_inputs[i]->mixer.fifo)
{
vlc_assert_locked( &p_aout->input_fifos_lock );
break;
vlc_mutex_init( &p_aout->mixer_lock );
vlc_mutex_init( &p_aout->output_fifo_lock );
p_aout->i_nb_inputs = 0;
- p_aout->mixer.f_multiplier = 1.0;
- p_aout->mixer.b_error = 1;
+ p_aout->mixer_multiplier = 1.0;
+ p_aout->p_mixer = NULL;
p_aout->output.b_error = 1;
p_aout->output.b_starving = 1;
{
switch ( p_format->i_physical_channels & AOUT_CHAN_PHYSMASK )
{
+ case AOUT_CHAN_LEFT:
+ case AOUT_CHAN_RIGHT:
case AOUT_CHAN_CENTER:
if ( (p_format->i_original_channels & AOUT_CHAN_CENTER)
|| (p_format->i_original_channels
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
- aout_DateInit( &p_fifo->end_date, i_rate );
+ date_Init( &p_fifo->end_date, i_rate, 1 );
}
/*****************************************************************************
p_fifo->pp_last = &p_buffer->p_next;
*p_fifo->pp_last = NULL;
/* Enforce the continuity of the stream. */
- if ( aout_DateGet( &p_fifo->end_date ) )
+ if ( date_Get( &p_fifo->end_date ) )
{
- p_buffer->start_date = aout_DateGet( &p_fifo->end_date );
- p_buffer->end_date = aout_DateIncrement( &p_fifo->end_date,
- p_buffer->i_nb_samples );
+ p_buffer->start_date = date_Get( &p_fifo->end_date );
+ p_buffer->end_date = date_Increment( &p_fifo->end_date,
+ p_buffer->i_nb_samples );
}
else
{
- aout_DateSet( &p_fifo->end_date, p_buffer->end_date );
+ date_Set( &p_fifo->end_date, p_buffer->end_date );
}
}
(void)p_aout;
AOUT_ASSERT_FIFO_LOCKED;
- aout_DateSet( &p_fifo->end_date, date );
+ date_Set( &p_fifo->end_date, date );
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
{
(void)p_aout;
AOUT_ASSERT_FIFO_LOCKED;
- aout_DateMove( &p_fifo->end_date, difference );
+ date_Move( &p_fifo->end_date, difference );
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
{
{
(void)p_aout;
AOUT_ASSERT_FIFO_LOCKED;
- return aout_DateGet( &p_fifo->end_date );
+ return date_Get( &p_fifo->end_date );
}
/*****************************************************************************
p_fifo->pp_last = &p_fifo->p_first;
}
-
-/*
- * Date management (internal and external)
- */
-
-/*****************************************************************************
- * aout_DateInit : set the divider of an audio_date_t
- *****************************************************************************/
-void aout_DateInit( audio_date_t * p_date, uint32_t i_divider )
-{
- p_date->date = 0;
- p_date->i_divider = i_divider;
- p_date->i_remainder = 0;
-}
-
-/*****************************************************************************
- * aout_DateSet : set the date of an audio_date_t
- *****************************************************************************/
-void aout_DateSet( audio_date_t * p_date, mtime_t new_date )
-{
- p_date->date = new_date;
- p_date->i_remainder = 0;
-}
-
-/*****************************************************************************
- * aout_DateMove : move forwards or backwards the date of an audio_date_t
- *****************************************************************************/
-void aout_DateMove( audio_date_t * p_date, mtime_t difference )
-{
- p_date->date += difference;
-}
-
-/*****************************************************************************
- * aout_DateGet : get the date of an audio_date_t
- *****************************************************************************/
-mtime_t aout_DateGet( const audio_date_t * p_date )
-{
- return p_date->date;
-}
-
-/*****************************************************************************
- * aout_DateIncrement : increment the date and return the result, taking
- * into account rounding errors
- *****************************************************************************/
-mtime_t aout_DateIncrement( audio_date_t * p_date, uint32_t i_nb_samples )
-{
- mtime_t i_dividend = INT64_C(1000000) * i_nb_samples;
- assert( p_date->i_divider > 0 ); /* uninitialized audio_data_t ? */
- p_date->date += i_dividend / p_date->i_divider;
- p_date->i_remainder += (int)(i_dividend % p_date->i_divider);
- if ( p_date->i_remainder >= p_date->i_divider )
- {
- /* This is Bresenham algorithm. */
- p_date->date++;
- p_date->i_remainder -= p_date->i_divider;
- }
- return p_date->date;
-}
-
/*****************************************************************************
* aout_CheckChannelReorder : Check if we need to do some channel re-ordering
*****************************************************************************/