Browse Source

ffplay: replace rint by lrint

avoids the float to integer cast, and is slightly superior in terms of
rounding ("Dutch/Gauss rounding").

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
tags/n3.0
Ganesh Ajjanagadde 9 years ago
parent
commit
f16e4a0857
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      ffplay.c

+ 2
- 2
ffplay.c View File

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


Loading…
Cancel
Save