From 4dfc2c50c18de74e73e3283773c1792b8a4b5a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 19 Jun 2023 20:32:44 +0200 Subject: hwdec: do not add hwdec device if it failed to create --- video/out/opengl/hwdec_dxva2gldx.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/out/opengl/hwdec_dxva2gldx.c') diff --git a/video/out/opengl/hwdec_dxva2gldx.c b/video/out/opengl/hwdec_dxva2gldx.c index 0a0784af4c..01728130d7 100644 --- a/video/out/opengl/hwdec_dxva2gldx.c +++ b/video/out/opengl/hwdec_dxva2gldx.c @@ -83,6 +83,12 @@ static int init(struct ra_hwdec *hw) .av_device_ref = d3d9_wrap_device_ref((IDirect3DDevice9 *)p->device), .hw_imgfmt = IMGFMT_DXVA2, }; + + if (!p->hwctx.av_device_ref) { + MP_VERBOSE(hw, "Failed to create hwdevice_ctx\n"); + return -1; + } + hwdec_devices_add(hw->devs, &p->hwctx); return 0; } -- cgit v1.2.3