Mercurial > emacs
diff src/sound.c @ 70955:d42f132da9a8
* sound.c (alsa_configure): Move get period/buffer_size after
setting hwparams.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Fri, 26 May 2006 06:29:32 +0000 |
parents | f8a3f870d0c4 |
children | 47e6374861d1 |
line wrap: on
line diff
--- a/src/sound.c Fri May 26 05:38:50 2006 +0000 +++ b/src/sound.c Fri May 26 06:29:32 2006 +0000 @@ -1019,6 +1019,9 @@ if ((err = snd_pcm_hw_params_set_channels (p->handle, p->hwparams, val)) < 0) alsa_sound_perror ("Could not set channel count", err); + if ((err = snd_pcm_hw_params (p->handle, p->hwparams)) < 0) + alsa_sound_perror ("Could not set parameters", err); + err = snd_pcm_hw_params_get_period_size (p->hwparams, &p->period_size, &dir); if (err < 0) @@ -1028,9 +1031,6 @@ if (err < 0) alsa_sound_perror("Unable to get buffer size for playback", err); - if ((err = snd_pcm_hw_params (p->handle, p->hwparams)) < 0) - alsa_sound_perror ("Could not set parameters", err); - err = snd_pcm_sw_params_current (p->handle, p->swparams); if (err < 0) alsa_sound_perror ("Unable to determine current swparams for playback",