From 8878c4a136b5b37d7e791d843fe777901bdac4bd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 21 Apr 2019 15:33:21 -0700 Subject: [PATCH] Use VAAPI decoder for AMD on Wayland --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index c0efbe6d..d50782e7 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -114,11 +114,12 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) "Driver: %s", vendorString ? vendorString : ""); - // AMD's Gallium VAAPI driver has a nasty memory leak - // that causes memory to be leaked for each submitted frame. - // The Flatpak runtime has a VDPAU driver in place that works - // well, so use that instead on AMD systems. - if (vendorString && qgetenv("FORCE_VAAPI") != "1") { + // AMD's Gallium VAAPI driver has a nasty memory leak that causes memory + // to be leaked for each submitted frame. The Flatpak runtime has a VDPAU + // driver in place that works well, so use that instead on AMD systems. If + // we're using Wayland, we have no choice but to use VAAPI because VDPAU + // is only supported under X11. + if (vendorString && qgetenv("FORCE_VAAPI") != "1" && m_WindowSystem == SDL_SYSWM_X11) { QString vendorStr(vendorString); if (vendorStr.contains("AMD", Qt::CaseInsensitive) || vendorStr.contains("Radeon", Qt::CaseInsensitive)) {