mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: make sure we recalculate config when samplerate changes
The threshold depends on the samplerate and even when the graph rate or quantum didn't change, the driver could be opened in a different samplerate, which would cause the timeouts to be wrong and cause xruns.
This commit is contained in:
parent
fa7cd96b6e
commit
a5d684af8a
1 changed files with 5 additions and 0 deletions
|
|
@ -1653,6 +1653,11 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
else
|
||||
state->frame_size *= rchannels;
|
||||
|
||||
/* make sure we updates threshold in check_position_config() because they depend
|
||||
* on the samplerate. */
|
||||
state->duration = 0;
|
||||
state->rate_denom = 0;
|
||||
|
||||
state->have_format = true;
|
||||
if (state->card->format_ref++ == 0)
|
||||
state->card->rate = rrate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue