mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
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:
parent
24bcacc619
commit
0913b3ef7b
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue