mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-26 07:58:03 -04:00
filter-graph: fix up def/min/max values for lv2
lv2 filters can return NAN for the min/max and default values when not specified. Handle them so that we don't end up clamping NAN numbers. Fixes #5166
This commit is contained in:
parent
31874b3764
commit
54d0d4e55a
1 changed files with 11 additions and 0 deletions
|
|
@ -560,6 +560,17 @@ static const struct spa_fga_descriptor *lv2_plugin_make_desc(void *plugin, const
|
||||||
fp->min = mins[i];
|
fp->min = mins[i];
|
||||||
fp->max = maxes[i];
|
fp->max = maxes[i];
|
||||||
fp->def = controls[i];
|
fp->def = controls[i];
|
||||||
|
|
||||||
|
if (isnan(fp->min))
|
||||||
|
fp->min = -FLT_MAX;
|
||||||
|
if (isnan(fp->max))
|
||||||
|
fp->max = FLT_MAX;
|
||||||
|
if (isnan(fp->def))
|
||||||
|
fp->def = 0.0f;
|
||||||
|
if (fp->max <= fp->min)
|
||||||
|
fp->max = FLT_MAX;
|
||||||
|
if (fp->def <= fp->min)
|
||||||
|
fp->min = -FLT_MAX;
|
||||||
}
|
}
|
||||||
return &desc->desc;
|
return &desc->desc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue