From e0d1be32fd986b749f05f80a917cb35d03301c75 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 26 Sep 2022 13:23:07 +0200 Subject: [PATCH] pulse-server: don't read more than requested size When we underrun, don't try to read more than what was requested even if there is more in the ringbuffer. --- src/modules/module-protocol-pulse/pulse-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 636da0d97..8fb96cb55 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1422,7 +1422,7 @@ static void stream_process(void *data) spa_ringbuffer_read_data(&stream->ring, stream->buffer, MAXLENGTH, index % MAXLENGTH, - p, avail); + p, SPA_MIN((uint32_t)avail, size)); index += avail; } pd.playing_for = size;