[vlc-commits] pulse: restore previous drain behavior

Thomas Guillem git at videolan.org
Tue Mar 19 18:08:26 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 19 18:05:48 2019 +0100| [e9f52b29c6a5892bfa5ab93c476c2aabe60b45b3] | committer: Thomas Guillem

pulse: restore previous drain behavior

Regression from 2049d408765d5f0209444025c21833624935ca37

Forgot to add it back after RĂ©mi mentionned it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9f52b29c6a5892bfa5ab93c476c2aabe60b45b3
---

 modules/audio_output/pulse.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index cc4af1e8c0..1091affcac 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -558,13 +558,20 @@ static void Drain(audio_output_t *aout)
     pa_operation *op = pa_stream_drain(s, NULL, NULL);
     if (op != NULL)
         pa_operation_unref(op);
-    pa_threaded_mainloop_unlock(sys->mainloop);
+    sys->last_date = VLC_TICK_INVALID;
 
     /* XXX: Loosy drain emulation.
      * See #18141: drain callback is never received */
     vlc_tick_t delay;
     if (TimeGet(aout, &delay) == 0 && delay <= VLC_TICK_FROM_SEC(5))
+    {
+        pa_threaded_mainloop_unlock(sys->mainloop);
         vlc_tick_sleep(delay);
+        pa_threaded_mainloop_lock(sys->mainloop);
+    }
+
+    stream_stop(s, aout);
+    pa_threaded_mainloop_unlock(sys->mainloop);
 }
 
 static int VolumeSet(audio_output_t *aout, float vol)



More information about the vlc-commits mailing list