jack: always invoke buffer callback

Always pause processing until the main loop has processed the buffer
change callback. This makes it less likely for clients in the same
process to use a new buffersize before the other client has received
the callback.

In carla, one client is receiving the buffer size callback and the other
clients are expexted to be paused until the callback for the client is
completed.
This commit is contained in:
Wim Taymans 2021-12-07 12:17:30 +01:00
parent fe417bd123
commit b71f47448c

View file

@ -1228,12 +1228,8 @@ static inline int check_buffer_frames(struct client *c, struct spa_io_position *
if (SPA_UNLIKELY(buffer_frames != c->buffer_frames)) { if (SPA_UNLIKELY(buffer_frames != c->buffer_frames)) {
pw_log_info("%p: bufferframes old:%d new:%d cb:%p", c, pw_log_info("%p: bufferframes old:%d new:%d cb:%p", c,
c->buffer_frames, buffer_frames, c->bufsize_callback); c->buffer_frames, buffer_frames, c->bufsize_callback);
if (c->bufsize_callback != NULL || c->latency_callback != NULL) { pw_loop_invoke(c->context.l, do_buffer_frames, 0,
pw_loop_invoke(c->context.l, do_buffer_frames, 0, &buffer_frames, sizeof(buffer_frames), false, c);
&buffer_frames, sizeof(buffer_frames), false, c);
} else {
c->buffer_frames = buffer_frames;
}
} }
return c->buffer_frames == buffer_frames; return c->buffer_frames == buffer_frames;
} }