<html><head></head><body>Seems ok<br><br><div class="gmail_quote">Le 13 mars 2019 16:55:51 GMT+08:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> src/audio_output/aout_internal.h | 3 ++-<br> src/audio_output/dec.c | 34 +++++++++++++++++++++-----------<br> src/input/decoder.c | 8 ++++----<br> 3 files changed, 29 insertions(+), 16 deletions(-)<br><br>diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h<br>index 1dd92e96aa..a1bc4cfe65 100644<br>--- a/src/audio_output/aout_internal.h<br>+++ b/src/audio_output/aout_internal.h<br>@@ -140,7 +140,8 @@ void aout_DecGetResetStats(audio_output_t *, unsigned *, unsigned *);<br> void aout_DecChangePause(audio_output_t *, bool b_paused, vlc_tick_t i_date);<br> void aout_DecChangeRate(audio_output_t *aout, float rate);<br> void aout_DecChangeDelay(audio_output_t *aout, vlc_tick_t delay);<br>-void aout_DecFlush(audio_output_t *, bool wait);<br>+void aout_DecFlush(audio_output_t *);<br>+void aout_DecDrain(audio_output_t *);<br> void aout_RequestRestart (audio_output_t *, unsigned);<br> void aout_RequestRetiming(audio_output_t *aout, vlc_tick_t system_ts,<br> vlc_tick_t audio_ts);<br>diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c<br>index 5295644891..638ff78e48 100644<br>--- a/src/audio_output/dec.c<br>+++ b/src/audio_output/dec.c<br>@@ -309,7 +309,7 @@ void aout_RequestRetiming(audio_output_t *aout, vlc_tick_t system_ts,<br> else<br> msg_Dbg (aout, "playback too late (%"PRId64"): "<br> "flushing buffers", drift);<br>- aout_DecFlush(aout, false);<br>+ aout_DecFlush(aout);<br> aout_StopResampling (aout);<br> <br> return; /* nothing can be done if timing is unknown */<br>@@ -498,22 +498,15 @@ void aout_DecChangeDelay(audio_output_t *aout, vlc_tick_t delay)<br> owner->sync.request_delay = delay;<br> }<br> <br>-void aout_DecFlush (audio_output_t *aout, bool wait)<br>+void aout_DecFlush(audio_output_t *aout)<br> {<br> aout_owner_t *owner = aout_owner (aout);<br> <br> if (owner->mixer_format.i_format)<br> {<br>- if (wait)<br>- {<br>- block_t *block = aout_FiltersDrain (owner->filters);<br>- if (block)<br>- aout->play(aout, block, vlc_tick_now());<br>- }<br>- else<br>- aout_FiltersFlush (owner->filters);<br>+ aout_FiltersFlush (owner->filters);<br> <br>- aout->flush(aout, wait);<br>+ aout->flush(aout, false);<br> vlc_clock_Reset(owner->sync.clock);<br> aout_FiltersResetClock(owner->filters);<br> <br>@@ -534,3 +527,22 @@ void aout_DecFlush (audio_output_t *aout, bool wait)<br> owner->sync.discontinuity = true;<br> owner->original_pts = VLC_TICK_INVALID;<br> }<br>+<br>+void aout_DecDrain(audio_output_t *aout)<br>+{<br>+ aout_owner_t *owner = aout_owner (aout);<br>+<br>+ if (!owner->mixer_format.i_format)<br>+ return;<br>+<br>+ block_t *block = aout_FiltersDrain (owner->filters);<br>+ if (block)<br>+ aout->play(aout, block, vlc_tick_now());<br>+ aout->flush(aout, true);<br>+<br>+ vlc_clock_Reset(owner->sync.clock);<br>+ aout_FiltersResetClock(owner->filters);<br>+<br>+ owner->sync.discontinuity = true;<br>+ owner->original_pts = VLC_TICK_INVALID;<br>+}<br>diff --git a/src/input/decoder.c b/src/input/decoder.c<br>index cf7fd43995..b698b4e90f 100644<br>--- a/src/input/decoder.c<br>+++ b/src/input/decoder.c<br>@@ -1138,7 +1138,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,<br> msg_Dbg( p_dec, "end of audio preroll" );<br> <br> if( p_owner->p_aout )<br>- aout_DecFlush( p_owner->p_aout, false );<br>+ aout_DecFlush( p_owner->p_aout );<br> }<br> <br> /* */<br>@@ -1465,7 +1465,7 @@ static void DecoderProcessFlush( decoder_t *p_dec )<br> if( p_dec->fmt_out.i_cat == AUDIO_ES )<br> {<br> if( p_owner->p_aout )<br>- aout_DecFlush( p_owner->p_aout, false );<br>+ aout_DecFlush( p_owner->p_aout );<br> }<br> else if( p_dec->fmt_out.i_cat == VIDEO_ES )<br> {<br>@@ -1688,7 +1688,7 @@ static void *DecoderThread( void *p_data )<br> { /* Draining: the decoder is drained and all decoded buffers are<br> * queued to the output at this point. Now drain the output. */<br> if( p_owner->p_aout != NULL )<br>- aout_DecFlush( p_owner->p_aout, true );<br>+ aout_DecDrain( p_owner->p_aout );<br> }<br> vlc_restorecancel( canc );<br> <br>@@ -1933,7 +1933,7 @@ static void DeleteDecoder( decoder_t * p_dec )<br> if( p_owner->p_aout )<br> {<br> /* TODO: REVISIT gap-less audio */<br>- aout_DecFlush( p_owner->p_aout, false );<br>+ aout_DecFlush( p_owner->p_aout );<br> aout_DecDelete( p_owner->p_aout );<br> input_resource_PutAout( p_owner->p_resource, p_owner->p_aout );<br> }</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>