[vlc-commits] pulse: fix playback with very small inputs
Thomas Guillem
git at videolan.org
Tue Jul 16 15:40:32 CEST 2019
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 12 13:08:40 2019 +0200| [9e644bdf34642dcf314d06ab10de69ac681566d8] | committer: Thomas Guillem
pulse: fix playback with very small inputs
(cherry picked from commit 0a1a317c452ea9c45ace3a485419010a449947f8)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9e644bdf34642dcf314d06ab10de69ac681566d8
---
modules/audio_output/pulse.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 1a36a7b647..359eb9cb74 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -559,6 +559,20 @@ static void Flush(audio_output_t *aout, bool wait)
pa_threaded_mainloop_lock(sys->mainloop);
+ if (unlikely(pa_stream_is_corked(s) > 0))
+ {
+ /* Drain while the stream is corked. It happens with very small input
+ * when the stream is drained while the start is still being deferred.
+ * In that case, we need start the stream before we actually drain it.
+ * */
+ if (sys->trigger != NULL)
+ {
+ vlc_pa_rttime_free(sys->mainloop, sys->trigger);
+ sys->trigger = NULL;
+ }
+ stream_start_now(s, aout);
+ }
+
if (wait)
{
op = pa_stream_drain(s, NULL, NULL);
More information about the vlc-commits
mailing list