resample: completely fill resampler

start with a completely filled resampler so that the first
input byte immediately gives an output sample. When then have
n_taps/2 leading (almost) 0 samples.

Also make the passthrough resampler act like the real resampler
by introducing an n_taps/2 delay.
This commit is contained in:
Wim Taymans 2019-09-05 13:10:00 +02:00
parent b1bfc900d6
commit a232e67dd8
2 changed files with 4 additions and 3 deletions

View file

@ -243,7 +243,7 @@ static void impl_native_reset (struct resample *r)
{
struct native_data *d = r->data;
memset(d->hist_mem, 0, r->channels * sizeof(float) * d->n_taps * 2);
d->hist = d->n_taps / 2;
d->hist = d->n_taps - 1;
d->phase = 0;
}