[pulseaudio-discuss] [PATCH v3 3/3] resampler: Add support for resamplers that consume less data than asked.

Wang Xingchao wangxingchao2011 at gmail.com
Fri May 11 00:49:34 PDT 2012

2012/5/10 Tanu Kaskinen <tanuk at iki.fi>:
> 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.)

I read through the patch and your change looks better than my initial idea.  :)
btw, can you reproduce the Bug 100% then i can do some test for your patch...


More information about the pulseaudio-discuss mailing list