[vlc-commits] pulse: fix drain with a workaround
Thomas Guillem
git at videolan.org
Sat Sep 2 17:40:42 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Sep 2 15:37:45 2017 +0200| [aa5e9fa1d10ed3cdfbf3e890b09ed3be33723e85] | committer: Thomas Guillem
pulse: fix drain with a workaround
Fixes #18141
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa5e9fa1d10ed3cdfbf3e890b09ed3be33723e85
---
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..a1d7a03e46 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;
+ while (TimeGet(aout, &delay) == 0 && delay > 0)
+ msleep(delay);
+ }
else
op = pa_stream_flush(s, NULL, NULL);
if (op != NULL)
More information about the vlc-commits
mailing list