diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-06-19 20:32:44 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-06-26 19:07:29 +0200 |
commit | 4dfc2c50c18de74e73e3283773c1792b8a4b5a77 (patch) | |
tree | 3a08dc939ca03575b09fecbcd20ed8f7541a4ab0 /video/out/opengl/hwdec_ios.m | |
parent | a5b929026100b7508d8fee6dbbea42f3a5db05fc (diff) | |
download | mpv-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_ios.m')
-rw-r--r-- | video/out/opengl/hwdec_ios.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/opengl/hwdec_ios.m b/video/out/opengl/hwdec_ios.m index 480c9d9fe6..380c107ec1 100644 --- a/video/out/opengl/hwdec_ios.m +++ b/video/out/opengl/hwdec_ios.m @@ -71,8 +71,12 @@ static int init(struct ra_hwdec *hw) .hw_imgfmt = IMGFMT_VIDEOTOOLBOX, }; - av_hwdevice_ctx_create(&p->hwctx.av_device_ref, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, - NULL, NULL, 0); + int ret = av_hwdevice_ctx_create(&p->hwctx.av_device_ref, + AV_HWDEVICE_TYPE_VIDEOTOOLBOX, NULL, NULL, 0); + if (ret != 0) { + MP_VERBOSE(hw, "Failed to create hwdevice_ctx: %s\n", av_err2str(ret)); + return -1; + } hwdec_devices_add(hw->devs, &p->hwctx); |