]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/hwcontext_opencl.c
hwcontext_opencl: use ff_hwframe_map_replace()
[ffmpeg] / libavutil / hwcontext_opencl.c
index 07458c2fb109ecf55c79e53a75a3eb4581cb59a8..d288ddb2a9220a61a124d5418972640215016951 100644 (file)
@@ -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);