[Ffmpeg-devel] [PATCH] Fix leak of AVPacket data in ffserver

Bryan Mayland bmayland
Mon Jan 23 23:38:13 CET 2006

Bryan Mayland wrote:
> I was noticing that ffserver memory usage steadily grows over time.  
> There are a couple reasons for this, but here is the big one.  When in 
> the HTTPSTATE_SEND_DATA state, we're basically in a 
> av_read_frame()/av_write_frame() loop.  If the av_write_frame doesn't 
> need a flush (which is the case when writing low bitrate [96kbit] asf 
> streams), nothing is written to the dynbuff and the code loops back to 
> read more frames to fill the outgoing buffer.  In this case however, 
> the data attached to the AVPacket is not freed with a call to 
> av_free_packet.
> This patch fixes that in the common case as well as in the case a 
> dynbuff could not be allocated.  NOTE:  This patch must be applied 
> *after* my ffserver_warning_clean2.diff patch.
    Dammit.  Helps if I attach the right patch.  This one attached 
correctly fixes both conditions.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffserver_packet_leak2.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060123/cb82b008/attachment.asc>

More information about the ffmpeg-devel mailing list