filter-graph: warn on clamped control values

Print a warning if a control value is clamped instead of silently
failing as the user might want to know if the intended
configuration was not applied successfully, such as filter
parameters.
This commit is contained in:
Niklas Carlsson 2026-05-11 11:52:57 +02:00 committed by Wim Taymans
parent f1b1f2d97b
commit ecc85f2959

View file

@ -617,7 +617,12 @@ static int port_set_control_value(struct port *port, float *value)
p = &node->desc->desc->ports[port->p];
get_ranges(impl, p, &def, &min, &max);
v = SPA_CLAMP(value ? *value : def, min, max);
v = value ? *value : def;
if (v < min || v > max) {
spa_log_warn(impl->log, "control value %f out of range [%f, %f]",
v, min, max);
v = SPA_CLAMP(v, min, max);
}
port->control_current = v;
port->control_initialized = true;