pulse-server: calculate buffer size based on the frame size

Audio with big frame sizes (especially audio with multiple channels) needs more
buffer size than the one calculated with the current formula. This patch uses
the frame size to calculate the buffer size, fixing playback issues for clients
configured in passthrough mode.
This commit is contained in:
Julian Bouzas 2021-08-27 08:49:12 -04:00 committed by Wim Taymans
parent b136bb8ca5
commit d4b06431ff

View file

@ -963,8 +963,8 @@ static const struct spa_pod *get_buffers_param(struct stream *s,
stride = s->frame_size;
if (s->direction == PW_DIRECTION_OUTPUT) {
maxsize = attr->tlength * 4;
size = attr->minreq * 2;
maxsize = attr->tlength * s->frame_size;
size = attr->minreq * s->frame_size;
} else {
size = attr->fragsize;
maxsize = attr->fragsize * MAX_BUFFERS;