mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
context: re-evaluate quantum/rate for moved nodes
When a node is moved from one driver to another, recheck if the new driver needs a quantum/rate change. Because the node was running on the old driver, the locked flag was checked and applied to the new driver, causing the new driver to keep running with the old (possible wrong) quantum/rate. Fixes #2293
This commit is contained in:
parent
339c22dce9
commit
2268d1838b
3 changed files with 9 additions and 1 deletions
|
|
@ -1198,7 +1198,11 @@ again:
|
||||||
/* collect quantum and rate */
|
/* collect quantum and rate */
|
||||||
spa_list_for_each(s, &n->follower_list, follower_link) {
|
spa_list_for_each(s, &n->follower_list, follower_link) {
|
||||||
|
|
||||||
if (s->info.state > PW_NODE_STATE_SUSPENDED) {
|
if (!s->moved) {
|
||||||
|
/* We only try to enforce the lock flags for nodes that
|
||||||
|
* are not recently moved between drivers. The nodes that
|
||||||
|
* are moved should try to enforce their quantum on the
|
||||||
|
* new driver. */
|
||||||
lock_quantum |= s->lock_quantum;
|
lock_quantum |= s->lock_quantum;
|
||||||
lock_rate |= s->lock_rate;
|
lock_rate |= s->lock_rate;
|
||||||
}
|
}
|
||||||
|
|
@ -1236,6 +1240,8 @@ again:
|
||||||
|
|
||||||
if (s->active)
|
if (s->active)
|
||||||
running = !n->passive;
|
running = !n->passive;
|
||||||
|
|
||||||
|
s->moved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force_quantum)
|
if (force_quantum)
|
||||||
|
|
|
||||||
|
|
@ -842,6 +842,7 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
|
||||||
old->name, old->info.id, driver->name, driver->info.id);
|
old->name, old->info.id, driver->name, driver->info.id);
|
||||||
|
|
||||||
node->driver_node = driver;
|
node->driver_node = driver;
|
||||||
|
node->moved = true;
|
||||||
|
|
||||||
pw_loop_invoke(node->data_loop,
|
pw_loop_invoke(node->data_loop,
|
||||||
do_move_nodes, SPA_ID_INVALID, &driver, sizeof(struct pw_impl_node *),
|
do_move_nodes, SPA_ID_INVALID, &driver, sizeof(struct pw_impl_node *),
|
||||||
|
|
|
||||||
|
|
@ -700,6 +700,7 @@ struct pw_impl_node {
|
||||||
unsigned int lock_rate:1; /**< don't change graph rate */
|
unsigned int lock_rate:1; /**< don't change graph rate */
|
||||||
unsigned int transport_sync:1; /**< supports transport sync */
|
unsigned int transport_sync:1; /**< supports transport sync */
|
||||||
unsigned int current_pending:1; /**< a quantum/rate update is pending */
|
unsigned int current_pending:1; /**< a quantum/rate update is pending */
|
||||||
|
unsigned int moved:1; /**< the node was moved drivers */
|
||||||
|
|
||||||
uint32_t port_user_data_size; /**< extra size for port user data */
|
uint32_t port_user_data_size; /**< extra size for port user data */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue