diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 5922bd1f..18f48386 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -277,6 +277,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 + // 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")) { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Trying fallback VAAPI driver paths"); @@ -298,7 +305,9 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) ); setPathVar = true; } - else { + else +#endif + { if (setPathVar) { // Unset LIBVA_DRIVERS_PATH if we set it ourselves // and we didn't find any working VAAPI drivers. diff --git a/app/streaming/video/ffmpeg-renderers/vdpau.cpp b/app/streaming/video/ffmpeg-renderers/vdpau.cpp index 9e2569a0..ae90f9d2 100644 --- a/app/streaming/video/ffmpeg-renderers/vdpau.cpp +++ b/app/streaming/video/ffmpeg-renderers/vdpau.cpp @@ -149,6 +149,13 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params) AV_HWDEVICE_TYPE_VDPAU, nullptr, nullptr, 0); +#if defined(APP_IMAGE) || defined(USE_FALLBACK_DRIVER_PATHS) + // AppImages will be running with our libvdpau.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 libvdpau.so and distro VDPAU drivers (native packages) + // b) They are using both runtime libvdpau.so and runtime VDPAU drivers (Flatpak/Snap) if (err < 0 && qEnvironmentVariableIsEmpty("VDPAU_DRIVER_PATH")) { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Trying fallback VDPAU driver paths"); @@ -173,6 +180,7 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params) qunsetenv("VDPAU_DRIVER_PATH"); } } +#endif if (err < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,