audioconvert: the delay of the resampler is in input rate

The resampler needs ntaps/2-1 (delay) input samples to produce 1 output
sample so the delay is measured in input rate.
This commit is contained in:
Wim Taymans 2025-01-15 17:02:39 +01:00
parent 0913b3ef7b
commit f914cf9327

View file

@ -2173,10 +2173,10 @@ static uint32_t resample_update_rate_match(struct impl *this, bool passthrough,
resample_update_rate(&this->resample, rate);
delay = resample_delay(&this->resample);
if (this->direction == SPA_DIRECTION_INPUT) {
delay = resample_in_len(&this->resample, delay);
match_size = resample_in_len(&this->resample, size);
} else {
match_size = resample_out_len(&this->resample, size);
delay = resample_out_len(&this->resample, delay);
}
}
match_size -= SPA_MIN(match_size, queued);