The initialisation should be common. For libmfx, it was previously
happening in the derivation function and this moves it out.
---
libavutil/hwcontext.c | 4 ++++
libavutil/hwcontext_qsv.c | 10 ----------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 6dc95bba1..157b73872 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -643,6 +643,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;
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 9270b2258..a47170b66 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -1058,16 +1058,6 @@ static int
qsv_device_derive_from_child(AVHWDeviceContext *ctx,
goto fail;
}
- ret = qsv_device_init(ctx);
- if (ret < 0)
- goto fail;
- if (s->handle_type != handle_type) {
- av_log(ctx, AV_LOG_ERROR, "Error in child device handle setup: "
- "type mismatch (%d != %d).\n", s->handle_type, handle_type);
- err = AVERROR_UNKNOWN;
- goto fail;
- }
-
return 0;
fail:
--
2.11.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel