Don't try VDPAU on XWayland by default

This commit is contained in:
Cameron Gutman 2021-12-15 20:49:12 -06:00
parent 1e6ca18193
commit 00d3530f64

View File

@ -1,6 +1,7 @@
#include <streaming/session.h>
#include "vdpau.h"
#include <streaming/streamutils.h>
#include <utils.h>
#include <SDL_syswm.h>
@ -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;