1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 15:21:46 +00:00

* sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open.

This commit is contained in:
Jan Djärv 2006-07-14 09:47:45 +00:00
parent ceb53a12f0
commit dcc881213c
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2006-07-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open.
2006-07-14 Kim F. Storm <storm@cua.dk>
* w32.c: Fix high cpu load for server sockets.

View File

@ -990,6 +990,7 @@ alsa_configure (sd)
struct sound_device *sd;
{
int val, err, dir;
unsigned uval;
struct alsa_params *p = (struct alsa_params *) sd->data;
snd_pcm_uframes_t buffer_size;
@ -1017,8 +1018,8 @@ alsa_configure (sd)
if (err < 0)
alsa_sound_perror ("Could not set sound format", err);
val = sd->sample_rate;
err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &val, 0);
uval = sd->sample_rate;
err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &uval, 0);
if (err < 0)
alsa_sound_perror ("Could not set sample rate", err);
@ -1123,7 +1124,7 @@ alsa_close (sd)
snd_pcm_sw_params_free (p->swparams);
if (p->handle)
{
snd_pcm_drain(p->handle);
snd_pcm_drain (p->handle);
snd_pcm_close (p->handle);
}
free (p);
@ -1269,7 +1270,8 @@ alsa_init (sd)
err = snd_pcm_open (&handle, file, SND_PCM_STREAM_PLAYBACK, 0);
snd_lib_error_set_handler (NULL);
if (err < 0)
return 0;
return 0;
snd_pcm_close (handle);
sd->fd = -1;
sd->open = alsa_open;