pulse-server: keep allocate buffer size around

For playback and capture streams we allocate MAXLENGTH (4M) buffers but
for upload streams we must allow space for the total upload stream, which
can be up to the max allowed sample size (16M).

Keep the allocated size for the stream around in a variable so that we
can use it when writing/reading to/from the ringbuffer.

This could later also be extended to use the attr.maxlength variable to
size the buffer (but it's usually 4M anyway). This is more complicated
because we need to grow the buffer size when new attributes are set,
which is probably more complicated than useful.
This commit is contained in:
Wim Taymans 2026-04-30 15:18:56 +02:00
parent 32648b7cc7
commit b7aae374bf
5 changed files with 23 additions and 21 deletions

View file

@ -163,8 +163,7 @@ void stream_free(struct stream *stream)
pw_work_queue_cancel(impl->work_queue, stream, SPA_ID_INVALID);
if (stream->buffer)
free(stream->buffer);
free(stream->buffer);
pw_properties_free(stream->props);