From 4f28edd4f76083904e593a919685f23a20453b17 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 5 Feb 2021 11:36:23 +0100 Subject: [PATCH] pulse-server: limit packets to fragsize When sending captured data to a client, pulseaudio limits the size of the block to the fragsize. Let's do the same just in case a client can't deal with more data. See #615 --- src/modules/module-protocol-pulse/pulse-server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index fcd045362..d92152fdb 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1513,6 +1513,11 @@ do_process_done(struct spa_loop *loop, avail = stream->attr.fragsize; index = stream->write_index - avail; } + else if (avail > (int32_t)stream->attr.fragsize) { + pw_log_debug(NAME" %p: [%s] limit avail:%d > frag:%u", + stream, client->name, avail, stream->attr.fragsize); + avail = stream->attr.fragsize; + } msg = message_alloc(impl, stream->channel, avail); if (msg == NULL)