On 2013-06-09 11:17, Sebastien Zwickert wrote:
--- a/libavcodec/vda.h
+++ b/libavcodec/vda.h
@@ -125,6 +125,17 @@ struct vda_context {
+
+ /**
+ * Use av_buffer to manage buffer.
+ * When the flag is set, the CVPixelBuffers returned by the decoder will
+ * be released automatically, so you have to retain them if necessary.
+ * Not setting this flag may cause memory leak.
Either write "memory leak_s_" or "a memory leak_".
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -123,6 +130,33 @@ static int vda_h264_end_frame(AVCodecContext *avctx)
+
+ /* VDA workaround to release properly each core video buffer:
properly release
+ * we need to create an extra av_buffer with a custom freeing callback.
This extra buffer
+ * should not be reference-counted to avoid potential memory leaks. That's
why we put it
+ * after the first free entry of AVFrame.buf to not reference this extra
buffer in
+ * AVFrame.av_frame_ref(). */
* We need to create an extra av_buffer with a custom freeing
callback.
* This extra buffer should not be reference-counted to avoid
potential
* memory leaks. That iss why it is placed after the first free
entry
* of AVFrame.buf to not reference this extra buffer
* in AVFrame.av_frame_ref(). */
Wait for more comments before sending a new patch.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel