mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Only use fallback VDPAU/VAAPI driver paths on AppImages
Native packages and Flatpak/Snap packages both have properly set driver path values embedded in libva.so/libvdpau.so. Let's not go splunking for drivers in random folders on those systems.
This commit is contained in:
parent
e130a15037
commit
4474f815af
@ -277,6 +277,13 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
break;
|
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")) {
|
if (qEnvironmentVariableIsEmpty("LIBVA_DRIVERS_PATH")) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Trying fallback VAAPI driver paths");
|
"Trying fallback VAAPI driver paths");
|
||||||
@ -298,7 +305,9 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
);
|
);
|
||||||
setPathVar = true;
|
setPathVar = true;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if (setPathVar) {
|
if (setPathVar) {
|
||||||
// Unset LIBVA_DRIVERS_PATH if we set it ourselves
|
// Unset LIBVA_DRIVERS_PATH if we set it ourselves
|
||||||
// and we didn't find any working VAAPI drivers.
|
// and we didn't find any working VAAPI drivers.
|
||||||
|
@ -149,6 +149,13 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
AV_HWDEVICE_TYPE_VDPAU,
|
AV_HWDEVICE_TYPE_VDPAU,
|
||||||
nullptr, nullptr, 0);
|
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")) {
|
if (err < 0 && qEnvironmentVariableIsEmpty("VDPAU_DRIVER_PATH")) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Trying fallback VDPAU driver paths");
|
"Trying fallback VDPAU driver paths");
|
||||||
@ -173,6 +180,7 @@ bool VDPAURenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
qunsetenv("VDPAU_DRIVER_PATH");
|
qunsetenv("VDPAU_DRIVER_PATH");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user