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

aout: inline aout_DecNewBuffer()

parent 59e4f588
......@@ -136,7 +136,6 @@ bool aout_ChangeFilterString( vlc_object_t *manager, vlc_object_t *aout,
int aout_DecNew(audio_output_t *, const audio_sample_format_t *,
const audio_replay_gain_t *, const aout_request_vout_t *);
void aout_DecDelete(audio_output_t *);
block_t *aout_DecNewBuffer(audio_output_t *, size_t);
void aout_DecDeleteBuffer(audio_output_t *, block_t *);
int aout_DecPlay(audio_output_t *, block_t *, int i_input_rate);
int aout_DecGetResetLost(audio_output_t *);
......
......@@ -182,25 +182,6 @@ void aout_RequestRestart (audio_output_t *aout, unsigned mode)
* Buffer management
*/
/*****************************************************************************
* aout_DecNewBuffer : ask for a new empty buffer
*****************************************************************************/
block_t *aout_DecNewBuffer (audio_output_t *aout, size_t samples)
{
/* NOTE: the caller is responsible for serializing input change */
aout_owner_t *owner = aout_owner (aout);
size_t length = samples * owner->input_format.i_bytes_per_frame
/ owner->input_format.i_frame_length;
block_t *block = block_Alloc( length );
if( likely(block != NULL) )
{
block->i_nb_samples = samples;
block->i_pts = block->i_length = 0;
}
return block;
}
/*****************************************************************************
* aout_DecDeleteBuffer : destroy an undecoded buffer
*****************************************************************************/
......
......@@ -2189,7 +2189,6 @@ static block_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
/* Parameters changed, restart the aout */
vlc_mutex_lock( &p_owner->lock );
DecoderFlushBuffering( p_dec );
aout_DecDelete( p_owner->p_aout );
......@@ -2261,13 +2260,21 @@ static block_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
p_dec->b_error = true;
return NULL;
}
aout_FormatPrepare( &p_owner->audio );
p_dec->fmt_out.audio.i_bytes_per_frame =
p_owner->audio.i_bytes_per_frame;
}
p_buffer = aout_DecNewBuffer( p_owner->p_aout, i_samples );
return p_buffer;
size_t length = i_samples * p_owner->audio.i_bytes_per_frame
/ p_owner->audio.i_frame_length;
block_t *block = block_Alloc( length );
if( likely(block != NULL) )
{
block->i_nb_samples = i_samples;
block->i_pts = block->i_length = 0;
}
return block;
}
static picture_t *vout_new_buffer( decoder_t *p_dec )
......
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