diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 6142e79e..90e042eb 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -341,14 +341,13 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) break; } -#if defined(APP_IMAGE) || defined(USE_FALLBACK_DRIVER_PATHS) - // AppImages will be running with our libva.so which means they don't know about + // AppImages may be running with our libva.so which means they don't know about // distro-specific driver paths. To avoid failing in this scenario, we'll hardcode // some such paths here for common distros. Non-AppImage packaging mechanisms won't // need this fallback because either: // a) They are using both distro libva.so and distro libva drivers (native packages) // b) They are using both runtime libva.so and runtime libva drivers (Flatpak/Snap) - if (qEnvironmentVariableIsEmpty("LIBVA_DRIVERS_PATH")) { + if (qEnvironmentVariableIsEmpty("LIBVA_DRIVERS_PATH") && qgetenv("VAAPI_USE_FALLBACK_PATHS") == "1") { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Trying fallback VAAPI driver paths"); @@ -370,7 +369,6 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) setPathVar = true; } else -#endif { if (setPathVar) { // Unset LIBVA_DRIVERS_PATH if we set it ourselves diff --git a/scripts/build-appimage.sh b/scripts/build-appimage.sh index e4b084a4..92670e91 100755 --- a/scripts/build-appimage.sh +++ b/scripts/build-appimage.sh @@ -113,6 +113,7 @@ LIBVA_FALLBACK="$APPDIR/opt/libva-fallback" if [ -d "$LIBVA_FALLBACK" ] && ! "$LIBVA_FALLBACK/libva-probe" 2>/dev/null; then export LD_LIBRARY_PATH="$LIBVA_FALLBACK${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export VAAPI_USE_FALLBACK_PATHS=1 fi exec "$APPDIR/usr/bin/moonlight" "$@"