Commit f16e4a08 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

ffplay: replace rint by lrint

avoids the float to integer cast, and is slightly superior in terms of
rounding ("Dutch/Gauss rounding").
Reviewed-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 0abdcae5
......@@ -927,10 +927,10 @@ static void calculate_display_rect(SDL_Rect *rect,
/* XXX: we suppose the screen has a 1.0 pixel ratio */
height = scr_height;
width = ((int)rint(height * aspect_ratio)) & ~1;
width = lrint(height * aspect_ratio) & ~1;
if (width > scr_width) {
width = scr_width;
height = ((int)rint(width / aspect_ratio)) & ~1;
height = lrint(width / aspect_ratio) & ~1;
}
x = (scr_width - width) / 2;
y = (scr_height - height) / 2;
......
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