mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-14 06:59:57 -05:00
impl-node: add support for node.force-rate=0
If you set node.force-rate=0, the rate will be forced to the node.rate denominator. This makes it possible to autiomatically make the graph switch to the native rate of the stream by setting this as the default property on streams. See #3026
This commit is contained in:
parent
3dc08c09d1
commit
9485b2819a
1 changed files with 10 additions and 7 deletions
|
|
@ -1024,8 +1024,10 @@ static void check_properties(struct pw_impl_node *node)
|
||||||
node->lock_rate = pw_properties_get_bool(node->properties, PW_KEY_NODE_LOCK_RATE, false);
|
node->lock_rate = pw_properties_get_bool(node->properties, PW_KEY_NODE_LOCK_RATE, false);
|
||||||
|
|
||||||
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) {
|
if (value == 0)
|
||||||
|
value = node->rate.denom;
|
||||||
|
if (node->force_rate != value) {
|
||||||
pw_log_info("(%s-%u) force-rate:%u -> %u", node->name,
|
pw_log_info("(%s-%u) force-rate:%u -> %u", node->name,
|
||||||
node->info.id, node->force_rate, value);
|
node->info.id, node->force_rate, value);
|
||||||
node->force_rate = value;
|
node->force_rate = value;
|
||||||
|
|
@ -1033,6 +1035,7 @@ static void check_properties(struct pw_impl_node *node)
|
||||||
recalc_reason = "force rate changed";
|
recalc_reason = "force rate changed";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pw_log_debug("%p: driver:%d recalc:%s active:%d", node, node->driver,
|
pw_log_debug("%p: driver:%d recalc:%s active:%d", node, node->driver,
|
||||||
recalc_reason, node->active);
|
recalc_reason, node->active);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue