vda: unlock the pixel buffer base address.
authorSebastien Zwickert <dilaroga@gmail.com>
Sat, 20 Jun 2015 11:19:29 +0000 (13:19 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 18 Jul 2015 18:23:45 +0000 (20:23 +0200)
The pixel buffer base address is never unlocked this causes
a bug with some pixel format types that are produced natively
by the hardware decoder: the first buffer was always used.
Unlock the pixel buffer base address fixes the issue.
(cherry picked from commit c06fdacc3dc706e70d953917fea845532d3703ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_vda.c

index d15648d..6fe4ed4 100644 (file)
@@ -77,6 +77,8 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
                   frame->width, frame->height);
 
     ret = av_frame_copy_props(vda->tmp_frame, frame);
+    CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
+
     if (ret < 0)
         return ret;