On Jun 8, 2013, at 8:51 PM, Luca Barbato <[email protected]> wrote:
> On 06/08/2013 01:01 PM, Sebastien Zwickert wrote: >> From: Xidorn Quan <[email protected]> >> >> This patch fixes a leak of buffer when seeking occurs. >> It adds a flag in struct vda_context for compatibility with apps which >> currently use it. If the flag is not set, the hwaccel will behave like >> before. >> --- >> libavcodec/vda.h | 11 +++++++++++ >> libavcodec/vda_h264.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- >> 2 files changed, 55 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/vda.h b/libavcodec/vda.h >> index 987b94f..13e4fc5 100644 >> --- a/libavcodec/vda.h >> +++ b/libavcodec/vda.h >> @@ -125,6 +125,17 @@ struct vda_context { >> * The reference size used for fast reallocation. >> */ >> int priv_allocated_size; >> + >> + /** >> + * 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. >> + * >> + * encoding: unused >> + * decoding: Set by user. >> + */ >> + int use_ref_buffer; >> }; >> >> /** Create the video decoder. */ >> diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c >> index 6c1845a..564fc81 100644 >> --- a/libavcodec/vda_h264.c >> +++ b/libavcodec/vda_h264.c >> @@ -28,6 +28,10 @@ >> #include "h264.h" >> #include "vda.h" >> >> +struct vda_buffer { >> + CVPixelBufferRef cv_buffer; >> +}; > > It is an unneeded level of indirection IMHO. You're absolutely right. Sorry I misunderstood your comment in the previous discussion about this level of indirection. Thanks! > […] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
