summaryrefslogtreecommitdiff
path: root/libs/ardour/vumeterdsp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/vumeterdsp.cc')
-rw-r--r--libs/ardour/vumeterdsp.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ardour/vumeterdsp.cc b/libs/ardour/vumeterdsp.cc
index 67d48f6c54..a3d0ec23c1 100644
--- a/libs/ardour/vumeterdsp.cc
+++ b/libs/ardour/vumeterdsp.cc
@@ -43,8 +43,8 @@ void Vumeterdsp::process (float *p, int n)
{
float z1, z2, m, t1, t2;
- z1 = _z1;
- z2 = _z2;
+ z1 = _z1 > 20 ? 20 : (_z1 < -20 ? -20 : _z1);
+ z2 = _z2 > 20 ? 20 : (_z2 < -20 ? -20 : _z2);
m = _res ? 0: _m;
_res = false;
@@ -64,6 +64,8 @@ void Vumeterdsp::process (float *p, int n)
if (z2 > m) m = z2;
}
+ if (isnan(z1)) z1 = 0;
+ if (isnan(z2)) z2 = 0;
_z1 = z1;
_z2 = z2 + 1e-10f;
_m = m;