mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
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:
parent
d310c0c460
commit
9d9a1af45a
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue