diff --git a/video/out/hwdec/hwdec_cuda_gl.c b/video/out/hwdec/hwdec_cuda_gl.c index d483de7f19..4c2535232f 100644 --- a/video/out/hwdec/hwdec_cuda_gl.c +++ b/video/out/hwdec/hwdec_cuda_gl.c @@ -106,14 +106,12 @@ static void cuda_ext_gl_uninit(const struct ra_hwdec_mapper *mapper, int n) #define CHECK_CU(x) check_cu(hw, (x), #x) static bool cuda_gl_check(const struct ra_hwdec *hw) { - if (ra_is_gl(hw->ra_ctx->ra)) { - GL *gl = ra_gl_get(hw->ra_ctx->ra); - if (gl->version < 210 && gl->es < 300) { - MP_VERBOSE(hw, "need OpenGL >= 2.1 or OpenGL-ES >= 3.0\n"); - return false; - } - } else { - // This is not an OpenGL RA. + if (!ra_is_gl(hw->ra_ctx->ra)) + return false; // This is not an OpenGL RA. + + GL *gl = ra_gl_get(hw->ra_ctx->ra); + if (gl->version < 210 && gl->es < 300) { + MP_VERBOSE(hw, "need OpenGL >= 2.1 or OpenGL-ES >= 3.0\n"); return false; } diff --git a/video/out/hwdec/hwdec_cuda_vk.c b/video/out/hwdec/hwdec_cuda_vk.c index 10b94931a0..73d38fb53d 100644 --- a/video/out/hwdec/hwdec_cuda_vk.c +++ b/video/out/hwdec/hwdec_cuda_vk.c @@ -273,18 +273,16 @@ static bool cuda_ext_vk_signal(const struct ra_hwdec_mapper *mapper, int n) static bool cuda_vk_check(const struct ra_hwdec *hw) { pl_gpu gpu = ra_pl_get(hw->ra_ctx->ra); - if (gpu != NULL) { - if (!(gpu->export_caps.tex & HANDLE_TYPE)) { - MP_VERBOSE(hw, "CUDA hwdec with Vulkan requires exportable texture memory of type 0x%X.\n", - HANDLE_TYPE); - return false; - } else if (!(gpu->export_caps.sync & HANDLE_TYPE)) { - MP_VERBOSE(hw, "CUDA hwdec with Vulkan requires exportable semaphores of type 0x%X.\n", - HANDLE_TYPE); - return false; - } - } else { - // This is not a Vulkan RA. + if (gpu == NULL) + return false; // This is not a Vulkan RA. + + if (!(gpu->export_caps.tex & HANDLE_TYPE)) { + MP_VERBOSE(hw, "CUDA hwdec with Vulkan requires exportable texture memory of type 0x%X.\n", + HANDLE_TYPE); + return false; + } else if (!(gpu->export_caps.sync & HANDLE_TYPE)) { + MP_VERBOSE(hw, "CUDA hwdec with Vulkan requires exportable semaphores of type 0x%X.\n", + HANDLE_TYPE); return false; }