mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: clamp buffer_frames correctly
Don't try to multiple the max_buffer_size with the frame scale or else we might try to set a min_buffer_size larger than the max_buffer_size. Instead, use the frame_scale only to scale the quantum_limit and then clamp against the max_buffer size. See #3000
This commit is contained in:
parent
4e1b10073a
commit
85a9e30908
1 changed files with 1 additions and 1 deletions
|
|
@ -2083,7 +2083,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
} else {
|
||||
CHECK(snd_pcm_hw_params_get_buffer_size_max(params, &state->buffer_frames), "get_buffer_size_max");
|
||||
|
||||
state->buffer_frames = SPA_MIN(state->buffer_frames, state->quantum_limit * 4)* state->frame_scale;
|
||||
state->buffer_frames = SPA_MIN(state->buffer_frames, state->quantum_limit * 4 * state->frame_scale);
|
||||
|
||||
CHECK(snd_pcm_hw_params_set_buffer_size_min(hndl, params, &state->buffer_frames), "set_buffer_size_min");
|
||||
CHECK(snd_pcm_hw_params_set_buffer_size_near(hndl, params, &state->buffer_frames), "set_buffer_size_near");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue