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/vo_mediacodec_embed.c | |
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/vo_mediacodec_embed.c')
-rw-r--r-- | video/out/vo_mediacodec_embed.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/vo_mediacodec_embed.c b/video/out/vo_mediacodec_embed.c index 3a1df2fd2c..bf12c49ceb 100644 --- a/video/out/vo_mediacodec_embed.c +++ b/video/out/vo_mediacodec_embed.c @@ -55,6 +55,12 @@ static int preinit(struct vo *vo) .av_device_ref = create_mediacodec_device_ref(vo), .hw_imgfmt = IMGFMT_MEDIACODEC, }; + + if (!p->hwctx.av_device_ref) { + MP_VERBOSE(hw, "Failed to create hwdevice_ctx\n"); + return -1; + } + hwdec_devices_add(vo->hwdec_devs, &p->hwctx); return 0; } |