summaryrefslogtreecommitdiff
path: root/libs/ffvpx/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-06-07 20:20:19 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-06-07 20:20:19 -0500
commit878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b (patch)
tree3683d6df35e3618c0e7b456de7c749ca4c8c21a6 /libs/ffvpx/libavutil/hwcontext.c
parenta621951327b0c19c0c24dfd9fd973f7bd13ae68f (diff)
parentcfb9884423faf741de03c5fcc72bf9ac8c6ada4d (diff)
downloadaura-central-878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b.tar.gz
Merge branch 'TRUNK' into ARE-5.0
Diffstat (limited to 'libs/ffvpx/libavutil/hwcontext.c')
-rw-r--r--libs/ffvpx/libavutil/hwcontext.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ffvpx/libavutil/hwcontext.c b/libs/ffvpx/libavutil/hwcontext.c
index 70c556eca..f1e404ab2 100644
--- a/libs/ffvpx/libavutil/hwcontext.c
+++ b/libs/ffvpx/libavutil/hwcontext.c
@@ -646,6 +646,9 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
ret = AVERROR(ENOMEM);
goto fail;
}
+ ret = av_hwdevice_ctx_init(dst_ref);
+ if (ret < 0)
+ goto fail;
goto done;
}
if (ret != AVERROR(ENOSYS))
@@ -658,10 +661,6 @@ 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;
@@ -871,3 +870,10 @@ fail:
av_buffer_unref(&dst_ref);
return ret;
}
+
+int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src)
+{
+ HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data;
+ av_frame_unref(hwmap->source);
+ return av_frame_ref(hwmap->source, src);
+}