[vlc-devel] [PATCH 4/4] RFC: aout: pulse: handle discontinuity

Rémi Denis-Courmont remi at remlab.net
Thu Jan 31 09:59:31 CET 2019


Hi,

Draining from within the Play callback will cause a potentially long sleep. This will have a variety of undesirable side effects such as messing up the clock and blocking volume/mute/device controls.

I suspect that it might even make buffering fail completely depending on output configuration.

No thanks.

Le 30 janvier 2019 13:28:13 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>No sure if really needed, since there is only one audio codec module
>that pass
>the discontinuity flag: the faad module.
>
>On other cases, a flush will always predate a discontinuity and this
>code path
>won't be triggered.
>---
> modules/audio_output/pulse.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/modules/audio_output/pulse.c
>b/modules/audio_output/pulse.c
>index 4ddc3ba7c8..21463628ab 100644
>--- a/modules/audio_output/pulse.c
>+++ b/modules/audio_output/pulse.c
>@@ -527,6 +527,14 @@ static void Play(audio_output_t *aout, block_t
>*block, vlc_tick_t date)
>      * will take place, and sooner or later a deadlock. */
>     pa_threaded_mainloop_lock(sys->mainloop);
> 
>+    if (unlikely(block->i_flags & BLOCK_FLAG_DISCONTINUITY
>+              && sys->last_date != VLC_TICK_INVALID))
>+    {
>+        /* Discontinuity, so the next block is likely in the future,
>drain the
>+         * stream and defer the next start. */
>+        FlushLocked(aout, true);
>+    }
>+
>     sys->last_date = date;
> 
>     if (pa_stream_is_corked(s) > 0)
>-- 
>2.20.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190131/8250b21f/attachment.html>


More information about the vlc-devel mailing list