From 68bafcf166d98539dfda949f40c7438c1e4b2ec6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 14 Jun 2022 11:18:52 +0200 Subject: [PATCH] pulse-server: Don't send more than fragsize chunks Send exactly fragsize chunks when capturing. See #2418 and #2434 --- src/modules/module-protocol-pulse/pulse-server.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index f5e931969..85939229f 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -87,9 +87,6 @@ #define DEFAULT_POSITION "[ FL FR ]" #define MAX_FORMATS 32 -/* The max amount of data we send in one block when capturing. In PulseAudio this - * size is derived from the mempool PA_MEMPOOL_SLOT_SIZE */ -#define MAX_FRAGSIZE (64*1024) #define TEMPORARY_MOVE_TIMEOUT (SPA_NSEC_PER_SEC) @@ -1326,8 +1323,7 @@ do_process_done(struct spa_loop *loop, } while ((uint32_t)avail >= stream->attr.fragsize) { - towrite = SPA_MIN(avail, MAX_FRAGSIZE); - towrite = SPA_ROUND_DOWN(towrite, stream->frame_size); + towrite = SPA_MIN((uint32_t)avail, stream->attr.fragsize); msg = message_alloc(impl, stream->channel, towrite); if (msg == NULL)