/*****************************************************************************
* aout_InputNew : allocate a new input and rework the filter pipeline
*****************************************************************************/
-aout_input_t *aout_InputNew (audio_output_t * p_aout,
- const audio_sample_format_t *restrict infmt,
- const audio_sample_format_t *restrict outfmt,
- const aout_request_vout_t *p_request_vout)
+aout_input_t *aout_InputNew (const audio_sample_format_t *restrict infmt)
{
- aout_input_t *p_input = malloc (sizeof (*p_input));
- if (unlikely(p_input == NULL))
- return NULL;
+ aout_input_t *p_input = xmalloc (sizeof (*p_input));
p_input->samplerate = infmt->i_rate;
- if (aout_FiltersNew (p_aout, infmt, outfmt, p_request_vout))
- {
- free(p_input);
- return NULL;
- }
-
p_input->i_resampling_type = AOUT_RESAMPLING_NONE;
p_input->i_last_input_rate = INPUT_RATE_DEFAULT;
p_input->i_buffer_lost = 0;
*****************************************************************************
* This function must be entered with the mixer lock.
*****************************************************************************/
-int aout_InputDelete( audio_output_t * p_aout, aout_input_t * p_input )
+void aout_InputDelete (aout_input_t * p_input )
{
- aout_FiltersDestroy (p_aout);
- (void) p_input;
- return 0;
+ free (p_input);
}
/*****************************************************************************
* synchronization
* Solution : resample the buffer to avoid a scratch.
*/
- p_input->i_resamp_start_date = now;
p_input->i_resamp_start_drift = (int)-drift;
p_input->i_resampling_type = (drift < 0) ? AOUT_RESAMPLING_DOWN
: AOUT_RESAMPLING_UP;
if( owner->resampler->fmt_in.audio.i_rate == i_nominal_rate )
{
p_input->i_resampling_type = AOUT_RESAMPLING_NONE;
- msg_Warn( p_aout, "resampling stopped after %"PRIi64" usec "
- "(drift: %"PRIi64")",
- now - p_input->i_resamp_start_date,
+ msg_Warn( p_aout, "resampling stopped (drift: %"PRIi64")",
p_buffer->i_pts - start_date);
}
else if( abs( (int)(p_buffer->i_pts - start_date) ) <