mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
impl-node: reset pending state when moving driving node
Commit d04a28daef moved the configuration
of the IO_Position after we removed the node from the old driver but
forgot to move the code that updates the pending_state.
See #4094
This commit is contained in:
parent
db31586298
commit
5cc7e583e2
1 changed files with 10 additions and 11 deletions
|
|
@ -1015,17 +1015,7 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
|
||||||
|
|
||||||
remove_segment_owner(old, node->info.id);
|
remove_segment_owner(old, node->info.id);
|
||||||
|
|
||||||
was_driving = node->driving;
|
pw_log_debug("%p: driver %p driving:%u", node, driver, node->driving);
|
||||||
|
|
||||||
/* When a node was driver (and is waiting for all nodes to complete
|
|
||||||
* the Start command) cancel the pending state and let the new driver
|
|
||||||
* calculate a new state so that the Start command is sent to the
|
|
||||||
* node */
|
|
||||||
if (was_driving && !node->driving)
|
|
||||||
impl->pending_state = node->info.state;
|
|
||||||
|
|
||||||
pw_log_debug("%p: driver %p driving:%u", node,
|
|
||||||
driver, node->driving);
|
|
||||||
pw_log_info("(%s-%u) -> change driver (%s-%d -> %s-%d)",
|
pw_log_info("(%s-%u) -> change driver (%s-%d -> %s-%d)",
|
||||||
node->name, node->info.id,
|
node->name, node->info.id,
|
||||||
old->name, old->info.id, driver->name, driver->info.id);
|
old->name, old->info.id, driver->name, driver->info.id);
|
||||||
|
|
@ -1042,11 +1032,20 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
|
||||||
* scheduled so it won't trigger yet */
|
* scheduled so it won't trigger yet */
|
||||||
node->to_driver_peer = pw_node_peer_ref(node, driver);
|
node->to_driver_peer = pw_node_peer_ref(node, driver);
|
||||||
|
|
||||||
|
was_driving = node->driving;
|
||||||
|
|
||||||
/* then set the new driver node activation */
|
/* then set the new driver node activation */
|
||||||
pw_impl_node_set_io(node, SPA_IO_Position,
|
pw_impl_node_set_io(node, SPA_IO_Position,
|
||||||
&driver->rt.target.activation->position,
|
&driver->rt.target.activation->position,
|
||||||
sizeof(struct spa_io_position));
|
sizeof(struct spa_io_position));
|
||||||
|
|
||||||
|
/* When a node was driver (and is waiting for all nodes to complete
|
||||||
|
* the Start command) cancel the pending state and let the new driver
|
||||||
|
* calculate a new state so that the Start command is sent to the
|
||||||
|
* node */
|
||||||
|
if (was_driving && !node->driving)
|
||||||
|
impl->pending_state = node->info.state;
|
||||||
|
|
||||||
/* and then make the driver trigger the node */
|
/* and then make the driver trigger the node */
|
||||||
node->from_driver_peer = pw_node_peer_ref(driver, node);
|
node->from_driver_peer = pw_node_peer_ref(driver, node);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue