mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
context: don't switch driver rate when nothing is running
When the driver has no followers to run, we can keep the current rate and don't need to switch. This avoids a useless switch to the default samplerate when all followers are removed.
This commit is contained in:
parent
fba7083f8c
commit
cb2cc28da0
1 changed files with 3 additions and 1 deletions
|
|
@ -1201,10 +1201,12 @@ again:
|
||||||
running = true;
|
running = true;
|
||||||
|
|
||||||
current_rate = n->current_rate.denom;
|
current_rate = n->current_rate.denom;
|
||||||
if (lock_rate || n->reconfigure ||
|
if (lock_rate || n->reconfigure || !running ||
|
||||||
(!force_rate &&
|
(!force_rate &&
|
||||||
(n->info.state > PW_NODE_STATE_IDLE)))
|
(n->info.state > PW_NODE_STATE_IDLE)))
|
||||||
/* when someone wants us to lock the rate of this driver or
|
/* when someone wants us to lock the rate of this driver or
|
||||||
|
* when we are in the process of reconfiguring the driver or
|
||||||
|
* when we are not running any followers or
|
||||||
* when the driver is busy and we don't need to force a rate,
|
* when the driver is busy and we don't need to force a rate,
|
||||||
* keep the current rate */
|
* keep the current rate */
|
||||||
target_rate = current_rate;
|
target_rate = current_rate;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue