From b22326124078b7d390fdbdd73c7b8a0c4fd3dd15 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 18 Dec 2021 12:32:20 +0100 Subject: [PATCH] pulse-server: flush after we push the last buffer --- src/modules/module-protocol-pulse/pulse-server.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index a029e66a4..a43efc4f8 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1219,6 +1219,7 @@ static void stream_process(void *data) struct spa_buffer *buf; uint32_t size, minreq = 0, index; struct process_data pd; + bool do_flush = false; if (stream->create_tag != SPA_ID_INVALID) return; @@ -1252,7 +1253,7 @@ static void stream_process(void *data) if (stream->draining) { stream->draining = false; - pw_stream_flush(stream->stream, true); + do_flush = true; } else { pd.underrun_for = size; pd.underrun = true; @@ -1329,6 +1330,9 @@ static void stream_process(void *data) } pw_stream_queue_buffer(stream->stream, buffer); + if (do_flush) + pw_stream_flush(stream->stream, true); + pw_stream_get_time(stream->stream, &pd.pwt); pw_loop_invoke(impl->loop,