Commit db0675fa authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: remove aout_mixer_input_t (no functional changes)

parent d1136fc4
......@@ -40,10 +40,6 @@ extern "C" {
typedef struct aout_mixer_sys_t aout_mixer_sys_t;
typedef struct aout_mixer_t aout_mixer_t;
typedef struct {
aout_fifo_t fifo;
} aout_mixer_input_t;
/**
* audio output mixer
*/
......@@ -59,8 +55,7 @@ struct aout_mixer_t {
*/
audio_sample_format_t fmt;
/* Array of mixer inputs */
aout_mixer_input_t *input;
aout_fifo_t *fifo;
/* Mix buffer (mandatory) */
void (*mix)(aout_mixer_t *, aout_buffer_t *, float);
......
......@@ -93,7 +93,7 @@ struct aout_input_t
aout_request_vout_t request_vout;
/* */
aout_mixer_input_t mixer;
aout_fifo_t fifo;
};
/****************************************************************************
......
......@@ -231,7 +231,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
if( i_duration != 0 )
{
for( aout_buffer_t *p = p_input->mixer.fifo.p_first; p != NULL; p = p->p_next )
for( aout_buffer_t *p = p_input->fifo.p_first; p != NULL; p = p->p_next )
{
p->i_pts += i_duration;
}
......@@ -243,7 +243,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
void aout_DecFlush( audio_output_t *p_aout, aout_input_t *p_input )
{
aout_lock( p_aout );
aout_FifoSet( &p_input->mixer.fifo, 0 );
aout_FifoSet( &p_input->fifo, 0 );
aout_unlock( p_aout );
}
......@@ -252,7 +252,7 @@ bool aout_DecIsEmpty( audio_output_t * p_aout, aout_input_t * p_input )
mtime_t end_date;
aout_lock( p_aout );
end_date = aout_FifoNextStart( &p_input->mixer.fifo );
end_date = aout_FifoNextStart( &p_input->fifo );
aout_unlock( p_aout );
return end_date <= mdate();
}
......@@ -81,7 +81,7 @@ int aout_InputNew( audio_output_t * p_aout, aout_input_t * p_input, const aout_r
p_input->i_nb_resamplers = p_input->i_nb_filters = 0;
/* Prepare FIFO. */
aout_FifoInit( p_aout, &p_input->mixer.fifo, p_aout->mixer_format.i_rate );
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
/* */
if( p_request_vout )
......@@ -446,7 +446,7 @@ int aout_InputDelete( audio_output_t * p_aout, aout_input_t * p_input )
aout_FiltersDestroyPipeline( p_input->pp_resamplers,
p_input->i_nb_resamplers );
p_input->i_nb_resamplers = 0;
aout_FifoDestroy( &p_input->mixer.fifo );
aout_FifoDestroy( &p_input->fifo );
return 0;
}
......@@ -465,16 +465,16 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
/* A little trick to avoid loosing our input fifo and properties */
aout_fifo_t fifo = p_input->mixer.fifo;
aout_fifo_t fifo = p_input->fifo;
bool b_paused = p_input->b_paused;
mtime_t i_pause_date = p_input->i_pause_date;
aout_FifoInit( p_aout, &p_input->mixer.fifo, p_aout->mixer_format.i_rate );
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
aout_InputDelete( p_aout, p_input );
aout_InputNew( p_aout, p_input, &p_input->request_vout );
p_input->mixer.fifo = fifo;
p_input->fifo = fifo;
p_input->b_paused = b_paused;
p_input->i_pause_date = i_pause_date;
......@@ -540,7 +540,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
/* We don't care if someone changes the start date behind our back after
* this. We'll deal with that when pushing the buffer, and compensate
* with the next incoming buffer. */
start_date = aout_FifoNextStart( &p_input->mixer.fifo );
start_date = aout_FifoNextStart( &p_input->fifo );
if ( start_date != 0 && start_date < now )
{
......@@ -549,7 +549,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
* happen :). */
msg_Warn( p_aout, "computed PTS is out of range (%"PRId64"), "
"clearing out", now - start_date );
aout_FifoSet( &p_input->mixer.fifo, 0 );
aout_FifoSet( &p_input->fifo, 0 );
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input );
......@@ -579,7 +579,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
{
msg_Warn( p_aout, "buffer way too early (%"PRId64"), clearing queue",
drift );
aout_FifoSet( &p_input->mixer.fifo, 0 );
aout_FifoSet( &p_input->fifo, 0 );
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input );
......@@ -692,7 +692,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
/* Adding the start date will be managed by aout_FifoPush(). */
p_buffer->i_pts = start_date;
aout_FifoPush( &p_input->mixer.fifo, p_buffer );
aout_FifoPush( &p_input->fifo, p_buffer );
}
/*****************************************************************************
......@@ -709,7 +709,7 @@ static void inputFailure( audio_output_t * p_aout, aout_input_t * p_input,
aout_FiltersDestroyPipeline( p_input->pp_filters, p_input->i_nb_filters );
aout_FiltersDestroyPipeline( p_input->pp_resamplers,
p_input->i_nb_resamplers );
aout_FifoDestroy( &p_input->mixer.fifo );
aout_FifoDestroy( &p_input->fifo );
var_Destroy( p_aout, "visual" );
var_Destroy( p_aout, "equalizer" );
var_Destroy( p_aout, "audio-filter" );
......
......@@ -51,7 +51,7 @@ int aout_MixerNew( audio_output_t * p_aout )
return VLC_EGENERIC;
p_mixer->fmt = p_aout->mixer_format;
p_mixer->input = &p_aout->p_input->mixer;
p_mixer->fifo = &p_aout->p_input->fifo;
p_mixer->mix = NULL;
p_mixer->sys = NULL;
......@@ -93,8 +93,7 @@ void aout_MixerDelete( audio_output_t * p_aout )
static int MixBuffer( audio_output_t * p_aout, float volume )
{
aout_mixer_t *p_mixer = p_aout->p_mixer;
aout_mixer_input_t *p_input = p_mixer->input;
aout_fifo_t *p_fifo = &p_input->fifo;
aout_fifo_t *p_fifo = p_mixer->fifo;
mtime_t now = mdate();
const unsigned samples = p_aout->i_nb_samples;
/* FIXME: Remove this silly constraint. Just pass buffers as they come to
......
......@@ -418,7 +418,7 @@ aout_buffer_t * aout_OutputNextBuffer( audio_output_t * p_aout,
msg_Warn( p_aout, "output date isn't PTS date, requesting "
"resampling (%"PRId64")", delta );
aout_FifoMoveDates( &p_aout->p_input->mixer.fifo, delta );
aout_FifoMoveDates( &p_aout->p_input->fifo, delta );
aout_FifoMoveDates( p_fifo, delta );
}
out:
......
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