From c92dc2495eb71c57798dcb3d9bbec9f87ae95e0a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 5 Dec 2025 23:52:41 -0600 Subject: [PATCH] Don't use vaPutSurface() if there are no valid subpicture formats --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 7f6e09c1..8a3eb821 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -603,6 +603,15 @@ VAAPIRenderer::isDirectRenderingSupported() "Using indirect rendering for YUV 4:4:4 video"); return false; } + else if (m_OverlayFormat.fourcc == 0) { + // We ordinarily wouldn't consider lack of overlay support to be a + // dealbreaker for picking a renderer, however the only cases I've + // ever seen overlay format selection fail is on systems that will + // also silently fail in vaPutSurface() too. + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Using indirect rendering due to lack of overlay support"); + return false; + } AVHWDeviceContext* deviceContext = (AVHWDeviceContext*)m_HwContext->data; AVVAAPIDeviceContext* vaDeviceContext = (AVVAAPIDeviceContext*)deviceContext->hwctx; @@ -615,12 +624,6 @@ VAAPIRenderer::isDirectRenderingSupported() if (entrypoints[i] == VAEntrypointVideoProc) { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Using direct rendering with VAEntrypointVideoProc"); - - if (m_OverlayFormat.fourcc == 0) { - SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, - "Unable to find supported subpicture format. Overlays will be unavailable!"); - } - return true; } }