audioconvert: report delay in input rate

The delay is always expressed in samples at the output rate of the
resampler. For input streams we need to convert this to the expected
input rate.

Make the delay reporting in playback streams more accurate.
This commit is contained in:
Wim Taymans 2025-01-15 15:25:49 +01:00
parent 24bcacc619
commit 0913b3ef7b

View file

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