From b70f32a2593dfcc46713ae8fc577de80df40c1ab Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 3 Sep 2022 13:07:09 +0200 Subject: [PATCH] pulse-server: enforce minfrag after latency adjust --- src/modules/module-protocol-pulse/pulse-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index ff7e1e995..e1df8476f 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -666,7 +666,6 @@ static uint32_t fix_record_buffer_attr(struct stream *s, struct buffer_attr *att attr->fragsize = frac_to_bytes_round_up(s->default_frag, &s->ss); attr->fragsize = SPA_MIN(attr->fragsize, attr->maxlength); attr->fragsize = SPA_ROUND_UP(attr->fragsize, frame_size); - attr->fragsize = SPA_MAX(attr->fragsize, minfrag); /* pulseaudio configures the source to half of the fragsize. It also * immediately sends chunks to clients. Configure a 2/3 of the fragsize @@ -676,6 +675,8 @@ static uint32_t fix_record_buffer_attr(struct stream *s, struct buffer_attr *att if (s->adjust_latency) attr->fragsize = SPA_ROUND_UP(latency, frame_size); + attr->fragsize = SPA_MAX(attr->fragsize, minfrag); + attr->tlength = attr->prebuf = 0; /* make sure can queue at least to fragsize without overruns */