[vlc-commits] vda: user ref buffer mode

David Fuhrmann git at videolan.org
Mon Sep 16 21:31:46 CEST 2013


vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Wed Sep 11 20:47:27 2013 +0200| [624962be26277cc6c70f2c13b32c81d1eb7a45f8] | committer: David Fuhrmann

vda: user ref buffer mode

This fixes memory leaks when seeking or dropping frames for other reasons.

close #8927
(cherry picked from commit c7a2a17a6d0b0f4c5c3e12fbe0dd12730d08c0f2)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=624962be26277cc6c70f2c13b32c81d1eb7a45f8
---

 configure.ac                |   26 +++++++++++++-------------
 modules/codec/avcodec/vda.c |    2 --
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9d27075..b10c5b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2388,24 +2388,24 @@ AS_IF([test "${enable_vda}" != "no"], [
   if test "${SYS}" = "darwin"; then
   AS_IF([test "x${have_avcodec}" = "xyes"], [
     AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
-      [
-        AC_CHECK_HEADERS(libavcodec/vda.h, [
-           have_avcodec_vda="yes"
-        ],[
-	AS_IF([test "${enable_vda}" = "yes"],
-	      [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
-              [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
-        ])
-  ],[
-	AS_IF([test "${enable_vda}" = "yes"],
-              [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
-              [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
+    [
+      PKG_CHECK_EXISTS([libavcodec >= 55.19.0], [
+        have_avcodec_vda="yes"
+      ],[
+        AS_IF([test "${enable_vda}" = "yes"],
+         [AC_MSG_ERROR([libavcodec >= 55.19.0 is required for VDA decoding])],
+         [AC_MSG_WARN([libavcodec >= 55.19.0 is required for VDA decoding])])
       ])
+    ],[
+	AS_IF([test "${enable_vda}" = "yes"],
+      [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
+      [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
+    ])
   ],[
     AS_IF([test "x${enable_vda}" != "x"], [
       AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
     ])
- ])
+  ])
   fi
 ])
 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c
index 6235599..5bdb4cc 100644
--- a/modules/codec/avcodec/vda.c
+++ b/modules/codec/avcodec/vda.c
@@ -106,7 +106,6 @@ static void vda_Copy420YpCbCr8Planar( picture_t *p_pic,
                   i_width, i_height, cache );
 
     CVPixelBufferUnlockBaseAddress( buffer, 0 );
-    CVPixelBufferRelease( buffer );
 }
 
 /*****************************************************************************
@@ -137,7 +136,6 @@ static void vda_Copy422YpCbCr8( picture_t *p_pic,
     }
 
     CVPixelBufferUnlockBaseAddress( buffer, 0 );
-    CVPixelBufferRelease( buffer );
 }
 
 static int Setup( vlc_va_t *external, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,



More information about the vlc-commits mailing list