[FFmpeg-cvslog] hwcontext_opencl: use ff_hwframe_map_replace()

Rostislav Pehlivanov git at videolan.org
Thu Jun 21 18:36:48 EEST 2018


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Fri Apr 20 05:30:04 2018 +0100| [a2613647c4f40b9e802cd21f37545ef1fdf370d1] | committer: Rostislav Pehlivanov

hwcontext_opencl: use ff_hwframe_map_replace()

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2613647c4f40b9e802cd21f37545ef1fdf370d1
---

 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 07458c2fb1..d288ddb2a9 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -2172,10 +2172,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);



More information about the ffmpeg-cvslog mailing list