summaryrefslogtreecommitdiffstats
path: root/video/out/d3d11/hwdec_dxva2dxgi.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-06-19 20:32:44 +0200
committersfan5 <sfan5@live.de>2023-06-26 19:07:29 +0200
commit4dfc2c50c18de74e73e3283773c1792b8a4b5a77 (patch)
tree3a08dc939ca03575b09fecbcd20ed8f7541a4ab0 /video/out/d3d11/hwdec_dxva2dxgi.c
parenta5b929026100b7508d8fee6dbbea42f3a5db05fc (diff)
downloadmpv-4dfc2c50c18de74e73e3283773c1792b8a4b5a77.tar.bz2
mpv-4dfc2c50c18de74e73e3283773c1792b8a4b5a77.tar.xz
hwdec: do not add hwdec device if it failed to create
Diffstat (limited to 'video/out/d3d11/hwdec_dxva2dxgi.c')
-rw-r--r--video/out/d3d11/hwdec_dxva2dxgi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/d3d11/hwdec_dxva2dxgi.c b/video/out/d3d11/hwdec_dxva2dxgi.c
index f68e0e3065..62158d467b 100644
--- a/video/out/d3d11/hwdec_dxva2dxgi.c
+++ b/video/out/d3d11/hwdec_dxva2dxgi.c
@@ -136,6 +136,12 @@ static int init(struct ra_hwdec *hw)
.av_device_ref = d3d9_wrap_device_ref((IDirect3DDevice9 *)p->dev9),
.hw_imgfmt = IMGFMT_DXVA2,
};
+
+ if (!p->hwctx.av_device_ref) {
+ MP_VERBOSE(hw, "Failed to create hwdevice_ctx\n");
+ goto done;
+ }
+
hwdec_devices_add(hw->devs, &p->hwctx);
ret = 0;