[FFmpeg-trac] #942(swresample:closed): swresample leaks memory when sampling up
FFmpeg
trac at avcodec.org
Mon Jan 30 23:22:38 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):
I know where I went wrong. I was not realizing here that the number of
samples changes during a resample. For some reason I was thinking that
the width of a sample changes, which is not going to be the case unless
the sample format changes as specified in the context. So that was just
my misunderstanding.
But you touched on an auxiliary issue about rounding. If I have
arbitrarily large amount of audio to resample over time, and the ratio is
not a nice multiple, what is the best way to avoid accumulating extra bits
in the internal swresample buffer without having to push extra non-samples
at the end of one of my buffers? And, for that matter, I don't think this
behavior of implicit buffering made perfectly clear to callers of the API
so we can knowingly avoid or compensate.
By the way, thanks for hanging with me on this one. swresample definitely
meets some specific needs of mine and dealing with memory well is
absolutely crucial on limited mobile devices.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/942#comment:13>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list