[FFmpeg-devel] [PATCH v2 2/8] hwcontext_opencl: use ff_hwframe_map_replace()

Rostislav Pehlivanov atomnuker at gmail.com
Sun Apr 22 19:47:45 EEST 2018


Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
---
 libavutil/hwcontext_opencl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
index 43b5c5ae0c..1d18da37bf 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -2171,10 +2171,7 @@ static int opencl_map_from_vaapi(AVHWFramesContext *dst_fc,
     if (err < 0)
         goto fail;
 
-    // Adjust the map descriptor so that unmap works correctly.
-    hwmap = (HWMapDescriptor*)dst->buf[0]->data;
-    av_frame_unref(hwmap->source);
-    err = av_frame_ref(hwmap->source, src);
+    err = ff_hwframe_map_replace(dst, src);
 
 fail:
     av_frame_free(&tmp);
-- 
2.17.0



More information about the ffmpeg-devel mailing list