pulseaudio/src/pulsecore/resampler
Georg Chini 656179a8fe resampler: Add pa_resampler_prepare() and pa_resampler_get_delay() functions
The pa_resampler_get_delay() function allows to retrieve the current resampler
delay in input samples for all supported resamplers. The return value is a double
to maintain precision when using variable rate resamplers. Because in many places
the delay is needed in usec, pa_resampler_get_delay_usec() was also supplied.

The speex resampler now skips leading zero samples to provide meaningful delay values.

In the next patch, the pa_resampler_prepare() function will be used to train the
resampler after a rewind. It takes data from a history memblockq and runs it through
the resampler. The output data is discarded.

To make this logic possible, the soxr resampler had to be converted to use variable
rate. The fixed rate version has a variable delay, therefore the logic above could
not be applied. Additionally, with fixed rate, the delay is larger than 150ms in
some situations, while with variable rate the delay is fixed and comparable to the
other resamplers.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/120>
2021-11-03 18:37:31 +00:00
..
ffmpeg.c resampler: Fix a memory leak in pa_resampler_ffmpeg_init() 2016-05-13 14:22:47 +05:30
libsamplerate.c update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
peaks.c update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00
soxr.c resampler: Add pa_resampler_prepare() and pa_resampler_get_delay() functions 2021-11-03 18:37:31 +00:00
speex.c resampler: Add pa_resampler_prepare() and pa_resampler_get_delay() functions 2021-11-03 18:37:31 +00:00
trivial.c update FSF addresses to FSF web page 2015-01-14 22:20:40 +02:00