mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-27 21:37:37 -04:00
impl-node: use port_update_state() in suspend_node
Instead of just setting the port state directly, go through the port_update_state() function. This will make suspend_node() also emit the port state change event to the links. This then causes the link to reset to INIT, which cancels pending complete_ready work items and prevents them from changing the port to READY without a valid format. One possible situation where this could happen is when a suspend happens while the port was waiting for a set_param(Format) reply from the client-node. See #3547
This commit is contained in:
parent
df32ab9844
commit
12ca6f16d2
1 changed files with 6 additions and 4 deletions
|
|
@ -558,16 +558,18 @@ static int suspend_node(struct pw_impl_node *this)
|
|||
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("%p: error unset format input: %s",
|
||||
this, spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_IMPL_PORT_STATE_CONFIGURE;
|
||||
/* force CONFIGURE in case of async, use update_state to
|
||||
* notify links so they can cancel pending work */
|
||||
pw_impl_port_update_state(p, PW_IMPL_PORT_STATE_CONFIGURE, 0, NULL);
|
||||
}
|
||||
|
||||
spa_list_for_each(p, &this->output_ports, link) {
|
||||
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||
pw_log_warn("%p: error unset format output: %s",
|
||||
this, spa_strerror(res));
|
||||
/* force CONFIGURE in case of async */
|
||||
p->state = PW_IMPL_PORT_STATE_CONFIGURE;
|
||||
/* force CONFIGURE in case of async, use update_state to
|
||||
* notify links so they can cancel pending work */
|
||||
pw_impl_port_update_state(p, PW_IMPL_PORT_STATE_CONFIGURE, 0, NULL);
|
||||
}
|
||||
|
||||
node_update_state(this, PW_NODE_STATE_SUSPENDED, 0, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue