summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-10-08 15:19:17 +0100
committerMark Thompson <sw@jkqxz.net>2017-10-09 00:11:53 +0100
commit309d660775e2b47af6723a0477c4d753bc0c54f4 (patch)
treecc1e0ea5ec58693ba4eafe9394b7dc69bf49abea /libavutil/hwcontext.c
parentf3602875b3255c533900df1c7bb4e78ef5e1ce08 (diff)
downloadffmpeg-309d660775e2b47af6723a0477c4d753bc0c54f4.tar.gz
hwcontext: Perform usual initialisation on derived device contexts
The initialisation should be common. For libmfx, it was previously happening in the derivation function and this moves it out. For VAAPI, it fixes some failures when deriving from a DRM device because this initialisation did not run.
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 2f4ee9661e..048e82126f 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -650,6 +650,10 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
goto fail;
done:
+ ret = av_hwdevice_ctx_init(dst_ref);
+ if (ret < 0)
+ goto fail;
+
*dst_ref_ptr = dst_ref;
return 0;