[FFmpeg-trac] #942(swresample:closed): swresample leaks memory when sampling up

FFmpeg trac at avcodec.org
Tue Jan 31 20:26:49 CET 2012


#942: swresample leaks memory when sampling up
------------------------------------+--------------------------------------
             Reporter:  beafdefx    |                    Owner:  michael
                 Type:  defect      |                   Status:  closed
             Priority:  normal      |                Component:  swresample
              Version:  git-master  |               Resolution:  invalid
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------

Comment (by beafdefx):

 In my particular case, I have allocated a large buffer (whatever FFmpeg
 says is the max audio buffer size, 192000 I think) to contain converted
 and resampled PCM and reuse that across the decoding session.  It gets
 allocated in Java and passed into native code which gets written into
 directly by FFmpeg.  I generally don't worry about overflows because I
 only process one packet at a time and bubble that PCM back up to the Java
 layer for output.  So I guess I can just tell the resampler to just use
 the entire contents of that buffer after the current AVPacket has been
 decoded into an AVFrame.

 As far as clarity for developers, I think your idea of providing a
 function to obtain the number of samples held in swr's internal buffers is
 a great idea.  It not only makes it clear that there is internal
 buffering, but it also makes it easy to tell at runtime if buffering is
 going on without having to drain the buffer.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/942#comment:15>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list