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
This commit is contained in:
Wim Taymans 2021-02-05 11:36:23 +01:00
parent c25bdce645
commit 4f28edd4f7

View file

@ -1513,6 +1513,11 @@ do_process_done(struct spa_loop *loop,
avail = stream->attr.fragsize; avail = stream->attr.fragsize;
index = stream->write_index - avail; 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); msg = message_alloc(impl, stream->channel, avail);
if (msg == NULL) if (msg == NULL)