From c6d8f6e618c2b979216f9a32686d6a4f2df42d61 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 22 Aug 2022 00:19:46 -0500 Subject: [PATCH] Allow D3D11VA to be disabled via environment variable --- app/streaming/video/ffmpeg-renderers/d3d11va.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/d3d11va.cpp b/app/streaming/video/ffmpeg-renderers/d3d11va.cpp index 12e3fce8..66307e9a 100644 --- a/app/streaming/video/ffmpeg-renderers/d3d11va.cpp +++ b/app/streaming/video/ffmpeg-renderers/d3d11va.cpp @@ -240,9 +240,14 @@ bool D3D11VARenderer::initialize(PDECODER_PARAMETERS params) m_DecoderParams = *params; - // Use DXVA2 on anything older than Win10, so we don't have to handle a bunch - // of legacy Win7/Win8 codepaths in here. - if (!IsWindows10OrGreater()) { + if (qgetenv("D3D11VA_ENABLED") == "0") { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "D3D11VA is disabled by environment variable"); + return false; + } + else if (!IsWindows10OrGreater()) { + // Use DXVA2 on anything older than Win10, so we don't have to handle a bunch + // of legacy Win7/Win8 codepaths in here. SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "D3D11VA renderer is only supported on Windows 10 or later."); return false;