mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
jack: make cycle_wait() loop until a valid cycle
pw_data_loop_wait() can return due to activity on another socket, so keep looping until cycle_run() gets a valid command. Fixes #1386
This commit is contained in:
parent
df8bd85277
commit
1c6326439f
1 changed files with 11 additions and 7 deletions
|
|
@ -1182,7 +1182,6 @@ static inline uint32_t cycle_run(struct client *c)
|
|||
struct pw_node_activation *activation = c->activation;
|
||||
struct pw_node_activation *driver = c->rt.driver_activation;
|
||||
|
||||
/* this is blocking if nothing ready */
|
||||
while (true) {
|
||||
if (SPA_UNLIKELY(read(fd, &cmd, sizeof(cmd)) != sizeof(cmd))) {
|
||||
if (errno == EINTR)
|
||||
|
|
@ -1237,13 +1236,18 @@ static inline uint32_t cycle_run(struct client *c)
|
|||
static inline uint32_t cycle_wait(struct client *c)
|
||||
{
|
||||
int res;
|
||||
uint32_t nframes;
|
||||
|
||||
res = pw_data_loop_wait(c->loop, -1);
|
||||
if (SPA_UNLIKELY(res <= 0)) {
|
||||
pw_log_warn(NAME" %p: wait error %m", c);
|
||||
return 0;
|
||||
}
|
||||
return cycle_run(c);
|
||||
do {
|
||||
res = pw_data_loop_wait(c->loop, -1);
|
||||
if (SPA_UNLIKELY(res <= 0)) {
|
||||
pw_log_warn(NAME" %p: wait error %m", c);
|
||||
return 0;
|
||||
}
|
||||
nframes = cycle_run(c);
|
||||
} while (!nframes);
|
||||
|
||||
return nframes;
|
||||
}
|
||||
|
||||
static inline void signal_sync(struct client *c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue