jack: only call buffer_size callback after change

Don't call the buffersize callback the first time but only when the
size changed since the last process or get_buffer_size() call.

Fixes #2324
This commit is contained in:
Wim Taymans 2022-04-23 21:37:45 +02:00
parent c9cf914d85
commit bb8a0b5e06

View file

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