alsa: keep more headroom when rate matching

When we are rate matching, keep some more headroom to make sure we
have enough data for the adaptive resampler.

Fixes crackling when following the dummy node and probably also when
following another capture device.
This commit is contained in:
Wim Taymans 2023-02-02 20:06:58 +01:00
parent 7e2dab876a
commit 8ffb74c8e2
1 changed files with 2 additions and 0 deletions

View File

@ -1879,6 +1879,8 @@ static int get_status(struct state *state, uint64_t current_time,
} else {
*delay = avail;
*target = SPA_MAX(*target, state->read_size);
if (state->matching)
*target += 32;
}
*target = SPA_CLAMP(*target, state->min_delay, state->buffer_frames);
return 0;