From 9d3f515b45dac7de3f082bec5cd961ae67e164de Mon Sep 17 00:00:00 2001 From: SDK Chan Date: Mon, 14 Jul 2025 18:18:09 +0000 Subject: [PATCH] [desktop] FreeBSD: Fix random crashes due to CUDA/VAAPI check sideeffects --- src/video_core/host1x/ffmpeg/ffmpeg.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video_core/host1x/ffmpeg/ffmpeg.cpp b/src/video_core/host1x/ffmpeg/ffmpeg.cpp index 9b718f2591..af1ebfe6fc 100644 --- a/src/video_core/host1x/ffmpeg/ffmpeg.cpp +++ b/src/video_core/host1x/ffmpeg/ffmpeg.cpp @@ -26,15 +26,20 @@ namespace { constexpr AVPixelFormat PreferredGpuFormat = AV_PIX_FMT_NV12; constexpr AVPixelFormat PreferredCpuFormat = AV_PIX_FMT_YUV420P; constexpr std::array PreferredGpuDecoders = { - AV_HWDEVICE_TYPE_CUDA, #ifdef _WIN32 AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DXVA2, + AV_HWDEVICE_TYPE_CUDA, + AV_HWDEVICE_TYPE_VULKAN, +#elif defined(__FreeBSD__) + AV_HWDEVICE_TYPE_VDPAU, + AV_HWDEVICE_TYPE_VULKAN, #elif defined(__unix__) AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_VDPAU, -#endif + AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_VULKAN, +#endif }; AVPixelFormat GetGpuFormat(AVCodecContext* codec_context, const AVPixelFormat* pix_fmts) {