impl-node: move quantum and rate

When we move a node from one driver to another, move the quantum and
rate if the target driver was idle so that we can mostly continue
uninterupted until a quantum/rate change is calculated.
This commit is contained in:
Wim Taymans 2021-09-08 11:51:09 +02:00
parent a3fe226eac
commit 9423e8d648

View file

@ -789,7 +789,17 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
remove_segment_owner(old, node->info.id);
if (old != node && old->driving && driver->info.state < PW_NODE_STATE_RUNNING) {
driver->rt.activation->position.clock.rate = old->rt.position->clock.rate;
driver->rt.activation->position.clock.duration = old->rt.position->clock.duration;
pw_log_info("move quantum:%"PRIu64" rate:%d (%s-%d -> %s-%d)",
driver->rt.activation->position.clock.duration,
driver->rt.activation->position.clock.rate.denom,
old->name, old->info.id,
driver->name, driver->info.id);
}
node->driving = node->driver && driver == node;
pw_log_debug(NAME" %p: driver %p driving:%u", node,
driver, node->driving);
pw_log_info("(%s-%u) -> change driver (%s-%d -> %s-%d)",