mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: limit headroom to buffer-size
We can never have more headroom that the total buffer-size so better clamp this here.
This commit is contained in:
parent
30659c5f61
commit
fda565864c
1 changed files with 2 additions and 0 deletions
|
|
@ -627,6 +627,8 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
if (is_batch)
|
||||
state->headroom += period_size;
|
||||
|
||||
state->headroom = SPA_MIN(state->headroom, state->buffer_frames);
|
||||
|
||||
state->period_frames = period_size;
|
||||
periods = state->buffer_frames / state->period_frames;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue