From d37742b4103b57036b23678fff9f90fedb7ffbfc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 30 Jan 2021 19:45:17 +0100 Subject: [PATCH] pulse-server: handle prebuf better prebuf == 0 should keep the read pointer updating prebuf > 0 should pause --- src/modules/module-protocol-pulse/pulse-server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 019efe60d..3de1423df 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1569,9 +1569,12 @@ static void stream_process(void *data) pw_stream_flush(stream->stream, true); } else { pd.underrun_for = size; - pd.playing_for = size; pd.underrun = true; } + if (stream->attr.prebuf == 0) { + pd.read_index += size; + spa_ringbuffer_read_update(&stream->ring, pd.read_index); + } } else { if (avail > (int32_t)stream->attr.maxlength) { /* overrun, reported by other side, here we skip