[FFmpeg-devel] [PATCH] add warning if some buffers were not released

Michael Niedermayer michaelni
Tue Oct 13 22:23:17 CEST 2009


On Tue, Oct 13, 2009 at 08:28:13PM +0200, Reimar D?ffinger wrote:
> Hello,
> as some of you may have noticed, there is a huge amount of decoders that
> do not properly release their buffers.
> valgrind doesn't show it because FFmpeg has code to make sure all are
> freed.
> Thus I propose this change that makes FFmpeg itself warn - hopefully
> then nobody writing decoders will forget those release_buffer anymore.
> I tested it with the 4xm decoder decoding to -f framecrc and there it works perfectly.
> Index: utils.c
> ===================================================================
> --- utils.c     (revision 20223)
> +++ utils.c     (working copy)
> @@ -946,6 +946,8 @@
>  
>      if(s->internal_buffer==NULL) return;
>  
> +    if (s->internal_buffer_count)
> +        av_log(s, AV_LOG_WARNING, "Found %i unreleased buffers!\n", s->internal_buffer_count);
>      for(i=0; i<INTERNAL_BUFFER_SIZE; i++){
>          InternalBuffer *buf= &((InternalBuffer*)s->internal_buffer)[i];
>          for(j=0; j<4; j++){
> 

patch ok


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091013/5fcd86b4/attachment.pgp>



More information about the ffmpeg-devel mailing list