summaryrefslogtreecommitdiff
path: root/gst/audiovisualizers
diff options
context:
space:
mode:
authorLuis de Bethencourt <luis.bg@samsung.com>2015-01-09 14:42:34 +0000
committerLuis de Bethencourt <luis.bg@samsung.com>2015-01-09 14:42:34 +0000
commit9d9a1af45ab9e670ae0bf814da65f9d420c0e7df (patch)
tree66a06ae135dc9cdaf6c8e6fa0dcb17ef5bd93469 /gst/audiovisualizers
parentd310c0c460b787320fa0d688147d0d91676b3e8e (diff)
downloadgstreamer-plugins-bad-9d9a1af45ab9e670ae0bf814da65f9d420c0e7df.tar.gz
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
Diffstat (limited to 'gst/audiovisualizers')
-rw-r--r--gst/audiovisualizers/gstwavescope.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c
index 6502b885d..b8a9e1f64 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;