filter-graph: only use min/max when defined in LADSPA

Fixes #5170
This commit is contained in:
Wim Taymans 2026-03-16 09:59:14 +01:00
parent 11d1f3653a
commit 90fd6fbc65
2 changed files with 11 additions and 4 deletions

View file

@ -1058,8 +1058,8 @@ static struct descriptor *descriptor_load(struct impl *impl, const char *type,
}
} else if (SPA_FGA_IS_PORT_CONTROL(fp->flags)) {
if (SPA_FGA_IS_PORT_INPUT(fp->flags)) {
spa_log_info(impl->log, "using port %lu ('%s') as control %d", p,
fp->name, desc->n_control);
spa_log_info(impl->log, "using port %lu ('%s') as control %d %f/%f/%f", p,
fp->name, desc->n_control, fp->def, fp->min, fp->max);
desc->control[desc->n_control++] = p;
}
else if (SPA_FGA_IS_PORT_OUTPUT(fp->flags)) {

View file

@ -7,6 +7,7 @@
#include <dlfcn.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <spa/utils/result.h>
#include <spa/utils/defs.h>
@ -113,8 +114,14 @@ static void ladspa_port_update_ranges(struct descriptor *dd, struct spa_fga_port
LADSPA_PortRangeHintDescriptor hint = d->PortRangeHints[p].HintDescriptor;
LADSPA_Data lower, upper;
lower = d->PortRangeHints[p].LowerBound;
upper = d->PortRangeHints[p].UpperBound;
if (hint & LADSPA_HINT_BOUNDED_BELOW)
lower = d->PortRangeHints[p].LowerBound;
else
lower = -FLT_MAX;
if (hint & LADSPA_HINT_BOUNDED_ABOVE)
upper = d->PortRangeHints[p].UpperBound;
else
upper = FLT_MAX;
port->hint = 0;
if (hint & LADSPA_HINT_TOGGLED)