mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-07 04:06:12 -05:00
impl-node: Don't suspend when links are busy
When suspend_on_idle is set and we got to idle, there is a chance that there is work in the work queue that is dependent on formats being set. In suspend_node, check whether the links have a non-zero busy count before suspending and return -EBUSY if they do.
This commit is contained in:
parent
f754741d58
commit
bb0efd777f
1 changed files with 15 additions and 0 deletions
|
|
@ -537,6 +537,21 @@ static int suspend_node(struct pw_impl_node *this)
|
|||
if (this->info.state > 0 && this->info.state <= PW_NODE_STATE_SUSPENDED)
|
||||
return 0;
|
||||
|
||||
spa_list_for_each(p, &this->input_ports, link) {
|
||||
if (p->busy_count > 0) {
|
||||
pw_log_debug("%p: can't suspend, input port %d busy:%d",
|
||||
this, p->port_id, p->busy_count);
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
spa_list_for_each(p, &this->output_ports, link) {
|
||||
if (p->busy_count > 0) {
|
||||
pw_log_debug("%p: can't suspend, output port %d busy:%d",
|
||||
this, p->port_id, p->busy_count);
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
|
||||
node_deactivate(this);
|
||||
|
||||
pw_log_debug("%p: suspend node driving:%d driver:%d prepared:%d", this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue