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
This commit is contained in:
Luis de Bethencourt 2015-01-09 14:42:34 +00:00
parent d310c0c460
commit 9d9a1af45a

View file

@ -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;