From dfa63297fcf92eee9b9abf30dc0c3a33412c4fb4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 4 May 2020 17:48:32 -0700 Subject: [PATCH] Fix incorrectly scaled output from the SDL renderer on macOS --- app/streaming/video/ffmpeg-renderers/sdlvid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp index f50a0382..340f87f5 100644 --- a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp @@ -177,14 +177,14 @@ bool SdlRenderer::initialize(PDECODER_PARAMETERS params) return false; } - // Calculate the video region size, scaling to fill the window while + // Calculate the video region size, scaling to fill the output size while // preserving the aspect ratio of the video stream. SDL_Rect src, dst; src.x = src.y = 0; src.w = params->width; src.h = params->height; dst.x = dst.y = 0; - SDL_GetWindowSize(params->window, &dst.w, &dst.h); + SDL_GetRendererOutputSize(m_Renderer, &dst.w, &dst.h); StreamUtils::scaleSourceToDestinationSurface(&src, &dst); // Ensure the viewport is set to the desired video region