From ec914e895ff6d7bf2d19e8c8785e5d8bfd38629f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 25 Dec 2023 05:21:42 -0800 Subject: Use standard methods for rounding --- examples/alffplay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/alffplay.cpp') diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index 890ecedb..a7633bfa 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -1509,9 +1509,9 @@ void VideoState::updateVideo(SDL_Window *screen, SDL_Renderer *renderer, bool re { double aspect_ratio = av_q2d(frame->sample_aspect_ratio); if(aspect_ratio >= 1.0) - frame_width = static_cast(frame_width*aspect_ratio + 0.5); + frame_width = static_cast(std::lround(frame_width * aspect_ratio)); else if(aspect_ratio > 0.0) - frame_height = static_cast(frame_height/aspect_ratio + 0.5); + frame_height = static_cast(std::lround(frame_height / aspect_ratio)); } SDL_SetWindowSize(screen, frame_width, frame_height); } -- cgit v1.2.3