mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
impl-node: clean up the configuration of the Position io area
Set the new IO Position after we removed the node from the old driver and before the new driver is going to schedule the node. This makes a little more sense.
This commit is contained in:
parent
1d0d67da1c
commit
d04a28daef
1 changed files with 11 additions and 4 deletions
|
|
@ -992,10 +992,6 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
|
||||||
|
|
||||||
was_driving = node->driving;
|
was_driving = node->driving;
|
||||||
|
|
||||||
pw_impl_node_set_io(node, SPA_IO_Position,
|
|
||||||
&driver->rt.target.activation->position,
|
|
||||||
sizeof(struct spa_io_position));
|
|
||||||
|
|
||||||
/* When a node was driver (and is waiting for all nodes to complete
|
/* 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
|
* 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
|
* calculate a new state so that the Start command is sent to the
|
||||||
|
|
@ -1009,15 +1005,26 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
|
||||||
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);
|
||||||
|
|
||||||
|
/* make sure the old driver doesn't trigger the node anymore */
|
||||||
pw_impl_node_remove_target(old, &node->rt.target);
|
pw_impl_node_remove_target(old, &node->rt.target);
|
||||||
|
/* make sure the node doesn't trigger the old driver anymore */
|
||||||
pw_impl_node_remove_target(node, &node->rt.driver_target);
|
pw_impl_node_remove_target(node, &node->rt.driver_target);
|
||||||
spa_zero(node->rt.driver_target);
|
spa_zero(node->rt.driver_target);
|
||||||
|
|
||||||
node->driver_node = driver;
|
node->driver_node = driver;
|
||||||
node->moved = true;
|
node->moved = true;
|
||||||
|
|
||||||
|
/* first send new driver target to node, the node is not yet being
|
||||||
|
* scheduled so it won't trigger yet */
|
||||||
copy_target(&node->rt.driver_target, &driver->rt.target);
|
copy_target(&node->rt.driver_target, &driver->rt.target);
|
||||||
pw_impl_node_add_target(node, &node->rt.driver_target);
|
pw_impl_node_add_target(node, &node->rt.driver_target);
|
||||||
|
|
||||||
|
/* then set the new driver node activation */
|
||||||
|
pw_impl_node_set_io(node, SPA_IO_Position,
|
||||||
|
&driver->rt.target.activation->position,
|
||||||
|
sizeof(struct spa_io_position));
|
||||||
|
|
||||||
|
/* and then make the driver trigger the node */
|
||||||
pw_impl_node_add_target(driver, &node->rt.target);
|
pw_impl_node_add_target(driver, &node->rt.target);
|
||||||
|
|
||||||
pw_impl_node_emit_driver_changed(node, old, driver);
|
pw_impl_node_emit_driver_changed(node, old, driver);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue