Commit 3fbd6865 authored by François Cartegnie's avatar François Cartegnie 🤞

vout: epg: use memset

parent b796710d
......@@ -156,7 +156,7 @@ static subpicture_region_t * vout_OSDEpgSlider(int x, int y,
int filled_part_width = ratio * width;
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
for (int i = 0; i < width; ) {
/* Slider border. */
bool is_outline = j == 0 || j == height - 1 ||
i == 0 || i == width - 1;
......@@ -166,7 +166,22 @@ static subpicture_region_t * vout_OSDEpgSlider(int x, int y,
i < 3 || i > width - 4 ||
i < filled_part_width;
picture->p->p_pixels[picture->p->i_pitch * j + i] = 2 * is_border + is_outline;
uint8_t color = 2 * is_border + is_outline;
if(i >= 3 && i < width - 4)
{
if(filled_part_width > 4)
memset(&picture->p->p_pixels[picture->p->i_pitch * j + i],
color, filled_part_width - 4);
if(width > filled_part_width + 4)
memset(&picture->p->p_pixels[picture->p->i_pitch * j + filled_part_width],
color, width - filled_part_width - 4);
i = __MAX(i+1, filled_part_width - 1);
}
else
{
picture->p->p_pixels[picture->p->i_pitch * j + i] = color;
i++;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment