From 00d3530f6465581e16622df24d275cf5510a718e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 15 Dec 2021 20:49:12 -0600 Subject: [PATCH] Don't try VDPAU on XWayland by default --- app/streaming/video/ffmpeg-renderers/vdpau.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/vdpau.cpp b/app/streaming/video/ffmpeg-renderers/vdpau.cpp index 654ff7b7..4b53adb0 100644 --- a/app/streaming/video/ffmpeg-renderers/vdpau.cpp +++ b/app/streaming/video/ffmpeg-renderers/vdpau.cpp @@ -1,6 +1,7 @@ #include #include "vdpau.h" #include +#include #include @@ -113,6 +114,15 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params) info.subsystem); return false; } + else if (qgetenv("VDPAU_XWAYLAND") != "1" && WMUtils::isRunningWayland()) { + // VDPAU initialization causes Moonlight to crash when using XWayland in a Flatpak + // on a system with the Nvidia 495.44 driver. VDPAU won't work under XWayland anyway, + // so let's not risk trying it (unless the user wants to roll the dice). + // https://gitlab.freedesktop.org/vdpau/libvdpau/-/issues/2 + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "VDPAU is disabled on XWayland. Set VDPAU_XWAYLAND=1 to try your luck."); + return false; + } m_VideoWidth = params->width; m_VideoHeight = params->height;