[vlc-devel] [PATCH 3/8] decoder: use new aout async API
Thomas Guillem
thomas at gllm.fr
Fri Mar 8 17:24:41 CET 2019
---
src/audio_output/aout_internal.h | 10 +++++-----
src/audio_output/output.c | 2 +-
src/input/decoder.c | 24 ++++++++++++------------
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index b221040597..422d084846 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -157,11 +157,6 @@ void aout_RequestRestart (audio_output_t *, unsigned);
void aout_RequestRetiming(audio_output_t *aout, vlc_tick_t system_ts,
vlc_tick_t audio_ts);
-static inline void aout_InputRequestRestart(audio_output_t *aout)
-{
- aout_RequestRestart(aout, AOUT_RESTART_FILTERS);
-}
-
static inline void aout_SetWavePhysicalChannels(audio_sample_format_t *fmt)
{
static const uint32_t wave_channels[] = {
@@ -188,6 +183,11 @@ void aout_ChangePause(audio_output_t *, bool paused, vlc_tick_t date);
void aout_ChangeRate(audio_output_t *, float rate);
void aout_ChangeDelay(audio_output_t *, vlc_tick_t delay);
+static inline void aout_InputRequestRestart(audio_output_t *aout)
+{
+ aout_Restart(aout, AOUT_RESTART_FILTERS, false);
+}
+
/* From filters.c */
/* Extended version of aout_FiltersNew
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 5b3447fb9f..c032ff8c08 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -151,7 +151,7 @@ out:
static void aout_RestartNotify (audio_output_t *aout, unsigned mode)
{
- aout_RequestRestart (aout, mode);
+ aout_Restart (aout, mode, true);
}
static int aout_GainNotify (audio_output_t *aout, float gain)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index e6eded1df0..1aa227a2ed 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -217,7 +217,7 @@ static int ReloadDecoder( decoder_t *p_dec, bool b_packetizer,
vlc_mutex_unlock( &p_owner->lock );
if( p_aout )
{
- aout_DecDelete( p_aout );
+ aout_Stop( p_aout );
input_resource_PutAout( p_owner->p_resource, p_aout );
}
}
@@ -297,7 +297,7 @@ static int aout_update_format( decoder_t *p_dec )
vlc_mutex_lock( &p_owner->lock );
p_owner->p_aout = NULL;
vlc_mutex_unlock( &p_owner->lock );
- aout_DecDelete( p_aout );
+ aout_Stop( p_aout );
input_resource_PutAout( p_owner->p_resource, p_aout );
}
@@ -341,8 +341,8 @@ static int aout_update_format( decoder_t *p_dec )
if( p_dec->fmt_out.i_codec == VLC_CODEC_DTS )
var_SetBool( p_aout, "dtshd", p_dec->fmt_out.i_profile > 0 );
- if( aout_DecNew( p_aout, &format, p_owner->p_clock,
- &p_dec->fmt_out.audio_replay_gain ) )
+ if( aout_Start( p_aout, &format, p_owner->p_clock,
+ &p_dec->fmt_out.audio_replay_gain ) )
{
input_resource_PutAout( p_owner->p_resource, p_aout );
p_aout = NULL;
@@ -1138,7 +1138,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,
msg_Dbg( p_dec, "end of audio preroll" );
if( p_owner->p_aout )
- aout_DecFlush( p_owner->p_aout, false );
+ aout_Flush( p_owner->p_aout, false );
}
/* */
@@ -1166,7 +1166,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,
if( p_aout != NULL && p_audio->i_pts != VLC_TICK_INVALID )
{
- int status = aout_DecPlay( p_aout, p_audio );
+ int status = aout_Play( p_aout, p_audio );
if( status == AOUT_DEC_CHANGED )
{
/* Only reload the decoder */
@@ -1465,7 +1465,7 @@ static void DecoderProcessFlush( decoder_t *p_dec )
if( p_dec->fmt_out.i_cat == AUDIO_ES )
{
if( p_owner->p_aout )
- aout_DecFlush( p_owner->p_aout, false );
+ aout_Flush( p_owner->p_aout, false );
}
else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{
@@ -1495,7 +1495,7 @@ static void OutputChangePause( decoder_t *p_dec, bool paused, vlc_tick_t date )
break;
case AUDIO_ES:
if( p_owner->p_aout != NULL )
- aout_DecChangePause( p_owner->p_aout, paused, date );
+ aout_ChangePause( p_owner->p_aout, paused, date );
break;
case SPU_ES:
break;
@@ -1517,7 +1517,7 @@ static void OutputChangeRate( decoder_t *p_dec, float rate )
break;
case AUDIO_ES:
if( p_owner->p_aout != NULL )
- aout_DecChangeRate( p_owner->p_aout, rate );
+ aout_ChangeRate( p_owner->p_aout, rate );
break;
case SPU_ES:
if( p_owner->p_vout != NULL )
@@ -1543,7 +1543,7 @@ static void OutputChangeDelay( decoder_t *p_dec, vlc_tick_t delay )
break;
case AUDIO_ES:
if( p_owner->p_aout != NULL )
- aout_DecChangeDelay( p_owner->p_aout, delay );
+ aout_ChangeDelay( p_owner->p_aout, delay );
break;
case SPU_ES:
if( p_owner->p_vout != NULL )
@@ -1688,7 +1688,7 @@ static void *DecoderThread( void *p_data )
{ /* Draining: the decoder is drained and all decoded buffers are
* queued to the output at this point. Now drain the output. */
if( p_owner->p_aout != NULL )
- aout_DecFlush( p_owner->p_aout, true );
+ aout_Flush( p_owner->p_aout, true );
}
vlc_restorecancel( canc );
@@ -1933,7 +1933,7 @@ static void DeleteDecoder( decoder_t * p_dec )
if( p_owner->p_aout )
{
/* TODO: REVISIT gap-less audio */
- aout_DecDelete( p_owner->p_aout );
+ aout_Stop( p_owner->p_aout );
input_resource_PutAout( p_owner->p_resource, p_owner->p_aout );
}
break;
--
2.20.1
More information about the vlc-devel
mailing list