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_d3d11egl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/out/opengl/hwdec_d3d11egl.c') diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c index 84b985906c..c3120914ea 100644 --- a/video/out/opengl/hwdec_d3d11egl.c +++ b/video/out/opengl/hwdec_d3d11egl.c @@ -185,6 +185,12 @@ static int init(struct ra_hwdec *hw) .supported_formats = subfmts, .hw_imgfmt = IMGFMT_D3D11, }; + + 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