mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-29 21:37:54 -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
0491458887
commit
c9d461bcf6
1 changed files with 6 additions and 4 deletions
|
|
@ -554,16 +554,18 @@ static int suspend_node(struct pw_impl_node *this)
|
||||||
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||||
pw_log_warn("%p: error unset format input: %s",
|
pw_log_warn("%p: error unset format input: %s",
|
||||||
this, spa_strerror(res));
|
this, spa_strerror(res));
|
||||||
/* force CONFIGURE in case of async */
|
/* force CONFIGURE in case of async, use update_state to
|
||||||
p->state = PW_IMPL_PORT_STATE_CONFIGURE;
|
* 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) {
|
spa_list_for_each(p, &this->output_ports, link) {
|
||||||
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
if ((res = pw_impl_port_set_param(p, SPA_PARAM_Format, 0, NULL)) < 0)
|
||||||
pw_log_warn("%p: error unset format output: %s",
|
pw_log_warn("%p: error unset format output: %s",
|
||||||
this, spa_strerror(res));
|
this, spa_strerror(res));
|
||||||
/* force CONFIGURE in case of async */
|
/* force CONFIGURE in case of async, use update_state to
|
||||||
p->state = PW_IMPL_PORT_STATE_CONFIGURE;
|
* 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);
|
node_update_state(this, PW_NODE_STATE_SUSPENDED, 0, NULL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue