diff options
Diffstat (limited to 'libs/ffvpx/libavutil/hwcontext.c')
-rw-r--r-- | libs/ffvpx/libavutil/hwcontext.c | 14 |
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); +} |