[FFmpeg-devel] [PATCH v3 4/4] avfilter/hwmap, hwupload: use new av_hwdevice_ctx_get_or_create_derived method

softworkz ffmpegagent at gmail.com
Fri Jul 22 02:39:43 EEST 2022


From: softworkz <softworkz at hotmail.com>

Signed-off-by: softworkz <softworkz at hotmail.com>
---
 libavfilter/vf_hwmap.c    | 4 ++--
 libavfilter/vf_hwupload.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_hwmap.c b/libavfilter/vf_hwmap.c
index 2e03dfc1fe..b79cf6732c 100644
--- a/libavfilter/vf_hwmap.c
+++ b/libavfilter/vf_hwmap.c
@@ -82,8 +82,8 @@ static int hwmap_config_output(AVFilterLink *outlink)
                 goto fail;
             }
 
-            err = av_hwdevice_ctx_create_derived(&device, type,
-                                                 hwfc->device_ref, 0);
+            err = av_hwdevice_ctx_get_or_create_derived(&device, type,
+                                                        hwfc->device_ref, 0);
             if (err < 0) {
                 av_log(avctx, AV_LOG_ERROR, "Failed to created derived "
                        "device context: %d.\n", err);
diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index dbc41734cc..41ee0e43c4 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -51,7 +51,7 @@ static int hwupload_query_formats(AVFilterContext *avctx)
         /* We already have a specified device. */
     } else if (avctx->hw_device_ctx) {
         if (ctx->device_type) {
-            err = av_hwdevice_ctx_create_derived(
+            err = av_hwdevice_ctx_get_or_create_derived(
                 &ctx->hwdevice_ref,
                 av_hwdevice_find_type_by_name(ctx->device_type),
                 avctx->hw_device_ctx, 0);
-- 
ffmpeg-codebot


More information about the ffmpeg-devel mailing list