summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_dxva2gldx.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/opengl/hwdec_dxva2gldx.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/opengl/hwdec_dxva2gldx.c')
-rw-r--r--video/out/opengl/hwdec_dxva2gldx.c6
1 files changed, 6 insertions, 0 deletions
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;
}