diff mbox series

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

Message ID d0957afde6aaa9e2a953364a6f91c96448a91a7f.1653142062.git.ffmpegagent@gmail.com
State New
Headers show
Series Add derive-device function which searches for existing devices in both directions | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/configure_armv7_RPi4 warning Failed to apply patch

Commit Message

softworkz May 21, 2022, 2:07 p.m. UTC
From: softworkz <softworkz@hotmail.com>

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

Patch

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);