resample: tweak the resampler to keep delay number of samples

Instead of requiring the upstream node to resubmit the delayed
samples, keep the samples ourselves. The benefit is probably too
small to measure but it simplifies things a lot.
This commit is contained in:
Wim Taymans 2021-01-08 16:35:26 +01:00
parent 84eed9ef6f
commit 7f007b6bca
3 changed files with 12 additions and 12 deletions

View file

@ -226,7 +226,7 @@ static void impl_native_process(struct resample *r,
if (SPA_LIKELY(hist)) {
/* first work on the history if any. */
if (SPA_UNLIKELY(hist < n_taps)) {
if (SPA_UNLIKELY(hist <= n_taps)) {
/* we need at least n_taps to completely process the
* history before we can work on the new input. When
* we have less, refill the history. */
@ -265,7 +265,7 @@ static void impl_native_process(struct resample *r,
r, *in_len, in, *out_len, out);
remain = *in_len - skip - in;
if (remain > 0 && remain < n_taps) {
if (remain > 0 && remain <= n_taps) {
/* not enough input data remaining for more output,
* copy to history */
for (c = 0; c < r->channels; c++)