From 9d9a1af45ab9e670ae0bf814da65f9d420c0e7df Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Fri, 9 Jan 2015 14:42:34 +0000 Subject: [PATCH] audiovisualizer: remove check if below zero for unsigned value CLAMP checks both if y is '< 0' and '> h1'. y will never be a negative number since it is an unsigned integer. Removing that check and only checking if it bigger than h1 and setting it to that max approprietaly. CID 1139792 --- gst/audiovisualizers/gstwavescope.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c index 6502b885d9..b8a9e1f64e 100644 --- a/gst/audiovisualizers/gstwavescope.c +++ b/gst/audiovisualizers/gstwavescope.c @@ -325,15 +325,18 @@ render_color_dots (GstAudioVisualizer * base, guint32 * vdata, filter ((gfloat) adata[s]); y = (guint) (oy + flt[0] * dy); - y = CLAMP (y, 0, h1); + if (y > h1) + y = h1; draw_dot_c (vdata, x, y, w, 0x00FF0000); y = (guint) (oy + flt[3] * dy); - y = CLAMP (y, 0, h1); + if (y > h1) + y = h1; draw_dot_c (vdata, x, y, w, 0x0000FF00); y = (guint) (oy + (flt[4] + flt[5]) * dy); - y = CLAMP (y, 0, h1); + if (y > h1) + y = h1; draw_dot_c (vdata, x, y, w, 0x000000FF); s += channels;