pulseaudio/src
Tanu Kaskinen 1eb7c4a465 resampler: Add support for resamplers that consume less data than asked.
libsamplerate_resample() assumed that src_process() would
always consume the whole input buffer. That was an invalid
assumption leading to crashes.

This patch adds a leftover memchunk for storing any
non-consumed input. When pa_resampler_run() is called next
time, the leftover is prepended to the new input.

Changes in v3:
 - Make the calculations in pa_resampler_result() and
   pa_resampler_max_block_size() more readable and more
   correct.
 - Rework the leftover storing: instead of using a dedicated
   buffer for it, store it in the beginning of remap_buf.
   This can avoid some memory copying. (The idea was
   suggested by Wang Xingchao.)
 - Use a generic save_leftover() function instead of doing
   the leftover copying in the resampler implementation.
 - Use the leftover logic also with the speex and ffmpeg
   resamplers.
   [ed: dropped the speex bit since the API guarantees that
    it will consume everything -- Arun]

Changes in v2:
 - If add_leftover() is called with zero-length input while
   the leftover length is non-zero, we don't try to acquire
   the input memblock.
 - Instead of taking a reference to the original input in
   libsamplerate_resample(), we copy the leftover data to a
   new memblock. This is done, because otherwise, if the
   input is one of the internal buffers, the data can get
   overwritten before reading it in add_leftover().
 - Store add_leftover_buf size in bytes instead of samples
   (more convenient, but less consistent with other code).

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=47156
2012-05-11 16:29:20 +05:30
..
daemon systemd: complement module-console-kit with module-systemd-login 2012-03-17 01:52:41 +01:00
modules echo-cancel: Clarify function call contexts. 2012-04-27 11:37:39 +03:00
pulse pulse: Fix warning in introspect.h; minor rewording and punctuation. 2012-04-17 18:15:42 +03:00
pulsecore resampler: Add support for resamplers that consume less data than asked. 2012-05-11 16:29:20 +05:30
tests format: Add API to query a property's type 2012-03-05 20:00:31 +05:30
utils pacmd: Added --help and --version options. 2012-05-05 13:35:18 +03:00
.gitignore build: Fix out-of-tree build 2012-02-20 19:23:47 +05:30
depmod.py remove remaining $ 2008-06-18 22:38:32 +02:00
Makefile.am build: Fix spelling in src/Makefile.am. 2012-04-17 18:14:50 +03:00
map-file format: Allow format->sample spec conversion for compressed formats 2012-03-05 20:30:33 +05:30