avconv: vda: Unlock the pixel buffer once it is accessed
authorSebastien Zwickert <dilaroga@gmail.com>
Wed, 8 Jul 2015 18:23:37 +0000 (20:23 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 8 Jul 2015 22:10:13 +0000 (00:10 +0200)
Avoid possible issues with memmapped hardware buffers in
case VDA is not doing a conversion on behalf of the user
and make the code more proper as working example.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
avconv_vda.c

index 40f87c4..d86076e 100644 (file)
@@ -76,6 +76,8 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
                   data, linesize, vda->tmp_frame->format,
                   frame->width, frame->height);
 
+    CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+
     ret = av_frame_copy_props(vda->tmp_frame, frame);
     if (ret < 0)
         return ret;