mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-26 07:00:13 -05:00
context: don't try to restore rate on !runnable nodes
There is no point in trying to restore a node to the default rate when it's not going to run. This avoids loops when rate switching from one forced rate to another.
This commit is contained in:
parent
108715ebfb
commit
7372a078b4
2 changed files with 3 additions and 1 deletions
|
|
@ -1304,7 +1304,7 @@ again:
|
||||||
s->moved = false;
|
s->moved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n->forced_rate && !force_rate) {
|
if (n->forced_rate && !force_rate && n->runnable) {
|
||||||
/* A node that was forced to a rate but is no longer being
|
/* A node that was forced to a rate but is no longer being
|
||||||
* forced can restore its rate */
|
* forced can restore its rate */
|
||||||
pw_log_info("(%s-%u) restore rate", n->name, n->info.id);
|
pw_log_info("(%s-%u) restore rate", n->name, n->info.id);
|
||||||
|
|
|
||||||
|
|
@ -1026,6 +1026,8 @@ static void check_properties(struct pw_impl_node *node)
|
||||||
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_FORCE_RATE))) {
|
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_FORCE_RATE))) {
|
||||||
if (spa_atou32(str, &value, 0) &&
|
if (spa_atou32(str, &value, 0) &&
|
||||||
node->force_rate != value) {
|
node->force_rate != value) {
|
||||||
|
pw_log_info("(%s-%u) force-rate:%u -> %u", node->name,
|
||||||
|
node->info.id, node->force_rate, value);
|
||||||
node->force_rate = value;
|
node->force_rate = value;
|
||||||
node->stamp = ++context->stamp;
|
node->stamp = ++context->stamp;
|
||||||
recalc_reason = "force rate changed";
|
recalc_reason = "force rate changed";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue