[vlc-commits] aout: inline aout_DecNewBuffer()
Rémi Denis-Courmont
git at videolan.org
Fri Jul 26 18:05:56 CEST 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul 26 19:04:14 2013 +0300| [32e1127d37fb301e8b47b1b7614159609e69895d] | committer: Rémi Denis-Courmont
aout: inline aout_DecNewBuffer()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=32e1127d37fb301e8b47b1b7614159609e69895d
---
src/audio_output/aout_internal.h | 1 -
src/audio_output/dec.c | 19 -------------------
src/input/decoder.c | 15 +++++++++++----
3 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index abe6513..f769ba1 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -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 *);
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 3fd0cff..f476eb7 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -183,25 +183,6 @@ void aout_RequestRestart (audio_output_t *aout, unsigned mode)
*/
/*****************************************************************************
- * 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
*****************************************************************************/
void aout_DecDeleteBuffer (audio_output_t *aout, block_t *block)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index b1b038c..db06ea4 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -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 )
More information about the vlc-commits
mailing list