[vlc-commits] pulse: fix drain with a workaround
    Thomas Guillem 
    git at videolan.org
       
    Sat Sep  2 17:49:51 CEST 2017
    
    
  
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Sep  2 15:37:45 2017 +0200| [a9df8abe82a8412bb554d6c970dfb5ed54857118] | committer: Thomas Guillem
pulse: fix drain with a workaround
Fixes #18141
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a9df8abe82a8412bb554d6c970dfb5ed54857118
---
 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 fb70933f38..be82ad7673 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -560,8 +560,15 @@ static void Flush(audio_output_t *aout, bool wait)
     pa_threaded_mainloop_lock(sys->mainloop);
 
     if (wait)
+    {
         op = pa_stream_drain(s, NULL, NULL);
-        /* TODO: wait for drain completion*/
+
+        /* XXX: Loosy drain emulation.
+         * See #18141: drain callback is never received */
+        mtime_t delay;
+        if (TimeGet(aout, &delay) == 0 && delay <= INT64_C(5000000))
+            msleep(delay);
+    }
     else
         op = pa_stream_flush(s, NULL, NULL);
     if (op != NULL)
    
    
More information about the vlc-commits
mailing list