pipewire-jack: only call timebase with valid buffer_frames

If the status passed to cycle_signal != 0 we should not call the
timebase callback. We already do this but we can use this fact to also
not call the timebase_callback when there was no buffer_frames
configured yet.

Do this by setting the fallback return value of process_callback to != 0.
When there is no buffer_frames yet, this will be used.

Also set the buffer_frames to the invalid value of -1 in jack_activate
instead of 0. -1 is the invalid value we check everywhere else.
This commit is contained in:
Wim Taymans 2026-03-19 12:58:30 +01:00
parent 19213d5d48
commit 4a90facafe

View file

@ -2210,7 +2210,7 @@ on_rtsocket_condition(void *data, int fd, uint32_t mask)
}
} else if (SPA_LIKELY(mask & SPA_IO_IN)) {
uint32_t buffer_frames;
int status = 0;
int status = -EBUSY;
buffer_frames = cycle_run(c);
@ -4875,7 +4875,7 @@ int jack_activate (jack_client_t *client)
freeze_callbacks(c);
/* reemit buffer_frames */
c->buffer_frames = 0;
c->buffer_frames = (uint32_t)-1;
pw_data_loop_start(c->loop);
c->active = true;
@ -5456,7 +5456,7 @@ SPA_EXPORT
jack_nframes_t jack_get_buffer_size (jack_client_t *client)
{
struct client *c = (struct client *) client;
jack_nframes_t res = -1;
uint32_t res = -1;
return_val_if_fail(c != NULL, 0);
@ -5473,7 +5473,7 @@ jack_nframes_t jack_get_buffer_size (jack_client_t *client)
}
c->buffer_frames = res;
pw_log_debug("buffer_frames: %u", res);
return res;
return (jack_nframes_t)res;
}
SPA_EXPORT