You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
4
ffplay.c
4
ffplay.c
@@ -927,10 +927,10 @@ static void calculate_display_rect(SDL_Rect *rect,
|
|||||||
|
|
||||||
/* XXX: we suppose the screen has a 1.0 pixel ratio */
|
/* XXX: we suppose the screen has a 1.0 pixel ratio */
|
||||||
height = scr_height;
|
height = scr_height;
|
||||||
width = ((int)rint(height * aspect_ratio)) & ~1;
|
width = lrint(height * aspect_ratio) & ~1;
|
||||||
if (width > scr_width) {
|
if (width > scr_width) {
|
||||||
width = scr_width;
|
width = scr_width;
|
||||||
height = ((int)rint(width / aspect_ratio)) & ~1;
|
height = lrint(width / aspect_ratio) & ~1;
|
||||||
}
|
}
|
||||||
x = (scr_width - width) / 2;
|
x = (scr_width - width) / 2;
|
||||||
y = (scr_height - height) / 2;
|
y = (scr_height - height) / 2;
|
||||||
|
Reference in New Issue
Block a user