Skip to content

Commit c7a2a17

Browse files
author
David Fuhrmann
committed
vda: user ref buffer mode
This fixes memory leaks when seeking or dropping frames for other reasons. close #8927
1 parent 49984f4 commit c7a2a17

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

configure.ac

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,24 +2384,24 @@ AS_IF([test "${enable_vda}" != "no"], [
23842384
if test "${SYS}" = "darwin"; then
23852385
AS_IF([test "x${have_avcodec}" = "xyes"], [
23862386
AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2387-
[
2388-
AC_CHECK_HEADERS(libavcodec/vda.h, [
2389-
have_avcodec_vda="yes"
2390-
],[
2391-
AS_IF([test "${enable_vda}" = "yes"],
2392-
[AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2393-
[AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2394-
])
2395-
],[
2396-
AS_IF([test "${enable_vda}" = "yes"],
2397-
[AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2398-
[AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2387+
[
2388+
PKG_CHECK_EXISTS([libavcodec >= 55.19.0], [
2389+
have_avcodec_vda="yes"
2390+
],[
2391+
AS_IF([test "${enable_vda}" = "yes"],
2392+
[AC_MSG_ERROR([libavcodec >= 55.19.0 is required for VDA decoding])],
2393+
[AC_MSG_WARN([libavcodec >= 55.19.0 is required for VDA decoding])])
23992394
])
2395+
],[
2396+
AS_IF([test "${enable_vda}" = "yes"],
2397+
[AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2398+
[AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2399+
])
24002400
],[
24012401
AS_IF([test "x${enable_vda}" != "x"], [
24022402
AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
24032403
])
2404-
])
2404+
])
24052405
fi
24062406
])
24072407
AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])

modules/codec/avcodec/vda.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ static void vda_Copy420YpCbCr8Planar( picture_t *p_pic,
106106
i_width, i_height, cache );
107107

108108
CVPixelBufferUnlockBaseAddress( buffer, 0 );
109-
CVPixelBufferRelease( buffer );
110109
}
111110

112111
/*****************************************************************************
@@ -137,7 +136,6 @@ static void vda_Copy422YpCbCr8( picture_t *p_pic,
137136
}
138137

139138
CVPixelBufferUnlockBaseAddress( buffer, 0 );
140-
CVPixelBufferRelease( buffer );
141139
}
142140

143141
static int Setup( vlc_va_t *external, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,

0 commit comments

Comments
 (0)