From 42960b7bf149f3dbd9e47f18792c07f2d182408a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 16 Jul 2023 16:54:13 -0500 Subject: [PATCH] Prefer nvidia-vaapi-driver over VDPAU for AV1 --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index a204c8d7..bf886e5b 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -194,9 +194,10 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) status = vaInitialize(vaDeviceContext->display, &major, &minor); } - if (status != VA_STATUS_SUCCESS && (m_WindowSystem != SDL_SYSWM_X11 || m_DecoderSelectionPass > 0)) { + if (status != VA_STATUS_SUCCESS && (m_WindowSystem != SDL_SYSWM_X11 || m_DecoderSelectionPass > 0 || (m_VideoFormat & VIDEO_FORMAT_MASK_AV1))) { // The unofficial nvidia VAAPI driver over NVDEC/CUDA works well on Wayland, - // but we'd rather use CUDA for XWayland and VDPAU for regular X11. + // but we'd rather use CUDA for XWayland and VDPAU for regular X11 and H.264/HEVC. + // We will prefer VAAPI for AV1 because older libvdpau versions don't support it. qputenv("LIBVA_DRIVER_NAME", "nvidia"); status = vaInitialize(vaDeviceContext->display, &major, &minor); }