Fixed repeated prepare call

This commit is contained in:
Abramo Bagnara 2001-02-05 09:35:17 +00:00
parent 4ecd9eaa46
commit a83b209df2
6 changed files with 14 additions and 5 deletions

View file

@ -2099,7 +2099,7 @@ int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
max periods
Return 0 on success or a negative number expressing the error.
*/
int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
int _snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
{
int err;
snd_pcm_sw_params_t sw;
@ -2154,6 +2154,14 @@ int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
pcm->access == SND_PCM_ACCESS_MMAP_COMPLEX) {
err = snd_pcm_mmap(pcm);
}
return err;
}
int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
{
int err;
assert(pcm && params);
err = _snd_pcm_hw_params(pcm, params);
if (err >= 0)
err = snd_pcm_prepare(pcm);
return err;