audioconvert: add resample.prefill option

Add a resampler option to prefill the resampler with 0. This then
results in the resampler always outputing and consuming the same
amount of data instead of a short buffer in the beginning.
This commit is contained in:
Wim Taymans 2022-09-19 12:35:49 +02:00
parent d48627d0e7
commit 31f9e18edb
3 changed files with 8 additions and 1 deletions

View file

@ -304,7 +304,10 @@ static void impl_native_reset (struct resample *r)
if (d == NULL)
return;
memset(d->hist_mem, 0, r->channels * sizeof(float) * d->n_taps * 2);
d->hist = (d->n_taps / 2) - 1;
if (r->options & RESAMPLE_OPTION_PREFILL)
d->hist = d->n_taps - 1;
else
d->hist = (d->n_taps / 2) - 1;
d->phase = 0;
}