[FFmpeg-trac] #942(swresample:closed): swresample leaks memory when sampling up
FFmpeg
trac at avcodec.org
Mon Jan 30 23:06:51 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 reimar):
I don't understand where your problem in understanding lies.
If you resample from 16000 samples per second to 32000 samples per second,
then your input of 16000 samples (i.e. one second) will become 32000
samples (since it is still one second of audio).
If your output buffer has only space available for 16000 samples that
leaves another 16000 of those resampled 32000 samples that the library
keeps buffered internally.
out_count is of course _not_ the "number of input samples that would
expand to a size that exactly fills this output buffer" because then
everyone getting the rounding wrong (the ratio will not always be a nice
1:2) would end up with a buffer overflow. If you have a better way of
clarifying this: patch welcome. It seemed clear enough to me, but that
doesn't mean much.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/942#comment:12>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list