mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
impl-node: improve node activation
Only activate the nodes when it was not-triggered, do this check with an atomic compare-and-swap so that we only activate a node once. We might be able to use this later to make sure that we resume the untriggered peer nodes when we remove a node from the graph.
This commit is contained in:
parent
9cb4d820d5
commit
74de723ecc
2 changed files with 29 additions and 24 deletions
|
|
@ -1888,13 +1888,16 @@ static inline void signal_sync(struct client *c)
|
|||
state->pending, state->required);
|
||||
|
||||
if (pw_node_activation_state_dec(state)) {
|
||||
l->activation->status = PW_NODE_ACTIVATION_TRIGGERED;
|
||||
l->activation->signal_time = nsec;
|
||||
if (SPA_ATOMIC_CAS(l->activation->status,
|
||||
PW_NODE_ACTIVATION_NOT_TRIGGERED,
|
||||
PW_NODE_ACTIVATION_TRIGGERED)) {
|
||||
l->activation->signal_time = nsec;
|
||||
|
||||
pw_log_trace_fp("%p: signal %p %p", c, l, state);
|
||||
pw_log_trace_fp("%p: signal %p %p", c, l, state);
|
||||
|
||||
if (SPA_UNLIKELY(write(l->signalfd, &cmd, sizeof(cmd)) != sizeof(cmd)))
|
||||
pw_log_warn("%p: write failed %m", c);
|
||||
if (SPA_UNLIKELY(write(l->signalfd, &cmd, sizeof(cmd)) != sizeof(cmd)))
|
||||
pw_log_warn("%p: write failed %m", c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue