context: don't try to change the quantum when idle

When the driver is going to be idle or not running, avoid updating
the quantum.

This is mostly when a node is moved to another driver. Changing the
quantum of the old driver would have the clients briefly see the useless
quantum before being moved to the new driver.
This commit is contained in:
Wim Taymans 2021-09-08 11:28:05 +02:00
parent 8f88792a9a
commit a3fe226eac

View file

@ -1321,7 +1321,7 @@ again:
if (context->settings.clock_power_of_two_quantum) if (context->settings.clock_power_of_two_quantum)
quantum = flp2(quantum); quantum = flp2(quantum);
if (quantum != n->rt.position->clock.duration && !lock_quantum) { if (running && quantum != n->rt.position->clock.duration && !lock_quantum) {
pw_log_info("(%s-%u) new quantum:%"PRIu64"->%u", pw_log_info("(%s-%u) new quantum:%"PRIu64"->%u",
n->name, n->info.id, n->name, n->info.id,
n->rt.position->clock.duration, n->rt.position->clock.duration,