[FFmpeg-cvslog] ffplay: replace rint by lrint
Ganesh Ajjanagadde
git at videolan.org
Fri Dec 25 22:14:01 CET 2015
ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Fri Dec 25 11:27:53 2015 -0800| [f16e4a0857e368a4828cd1fbfda7f44cbbf83f06] | committer: 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: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f16e4a0857e368a4828cd1fbfda7f44cbbf83f06
---
ffplay.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ffplay.c b/ffplay.c
index 2f8a0bf..e1e8535 100644
--- a/ffplay.c
+++ b/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 */
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;
More information about the ffmpeg-cvslog
mailing list