mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Fixed the period size setup for hardware with fixed values
This commit is contained in:
parent
87b5b249a5
commit
ef035eacfe
1 changed files with 8 additions and 4 deletions
|
|
@ -218,14 +218,18 @@ int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, int *bufsize)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
size = snd_pcm_hw_params_get_buffer_size(p_params) / 2;
|
||||
size = snd_pcm_hw_params_get_period_size(p_params, NULL);
|
||||
if (size > *bufsize)
|
||||
*bufsize = size;
|
||||
size = snd_pcm_hw_params_get_buffer_size(c_params) / 2;
|
||||
size = snd_pcm_hw_params_get_period_size(c_params, NULL);
|
||||
if (size > *bufsize)
|
||||
*bufsize = size;
|
||||
if (snd_pcm_hw_params_get_buffer_size(p_params) !=
|
||||
snd_pcm_hw_params_get_buffer_size(c_params))
|
||||
if (snd_pcm_hw_params_get_period_time(p_params, NULL) !=
|
||||
snd_pcm_hw_params_get_period_time(c_params, NULL))
|
||||
goto __again;
|
||||
if (snd_pcm_hw_params_get_period_size(p_params, NULL) * 2 < snd_pcm_hw_params_get_buffer_size(p_params))
|
||||
goto __again;
|
||||
if (snd_pcm_hw_params_get_period_size(c_params, NULL) * 2 < snd_pcm_hw_params_get_buffer_size(c_params))
|
||||
goto __again;
|
||||
|
||||
if ((err = setparams_set(phandle, p_params, p_swparams, "playback")) < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue