diff options
| author | Jan Djärv | 2006-07-14 09:47:45 +0000 |
|---|---|---|
| committer | Jan Djärv | 2006-07-14 09:47:45 +0000 |
| commit | dcc881213c9b7d6b6df11f394ce62f3a747c9ec5 (patch) | |
| tree | e6432250e8f7dfe8faab5ab2e979b040c7a54100 /src | |
| parent | ceb53a12f007c30185e5cf86ffec6c073883bbee (diff) | |
| download | emacs-dcc881213c9b7d6b6df11f394ce62f3a747c9ec5.tar.gz emacs-dcc881213c9b7d6b6df11f394ce62f3a747c9ec5.zip | |
* sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/sound.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aaa464cfd68..591bb2fefe9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-07-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * sound.c (alsa_init): Call snd_pcm_close after successful snd_pcm_open. | ||
| 4 | |||
| 1 | 2006-07-14 Kim F. Storm <storm@cua.dk> | 5 | 2006-07-14 Kim F. Storm <storm@cua.dk> |
| 2 | 6 | ||
| 3 | * w32.c: Fix high cpu load for server sockets. | 7 | * w32.c: Fix high cpu load for server sockets. |
diff --git a/src/sound.c b/src/sound.c index af2369040cc..6f955a7d691 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -990,6 +990,7 @@ alsa_configure (sd) | |||
| 990 | struct sound_device *sd; | 990 | struct sound_device *sd; |
| 991 | { | 991 | { |
| 992 | int val, err, dir; | 992 | int val, err, dir; |
| 993 | unsigned uval; | ||
| 993 | struct alsa_params *p = (struct alsa_params *) sd->data; | 994 | struct alsa_params *p = (struct alsa_params *) sd->data; |
| 994 | snd_pcm_uframes_t buffer_size; | 995 | snd_pcm_uframes_t buffer_size; |
| 995 | 996 | ||
| @@ -1017,8 +1018,8 @@ alsa_configure (sd) | |||
| 1017 | if (err < 0) | 1018 | if (err < 0) |
| 1018 | alsa_sound_perror ("Could not set sound format", err); | 1019 | alsa_sound_perror ("Could not set sound format", err); |
| 1019 | 1020 | ||
| 1020 | val = sd->sample_rate; | 1021 | uval = sd->sample_rate; |
| 1021 | err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &val, 0); | 1022 | err = snd_pcm_hw_params_set_rate_near (p->handle, p->hwparams, &uval, 0); |
| 1022 | if (err < 0) | 1023 | if (err < 0) |
| 1023 | alsa_sound_perror ("Could not set sample rate", err); | 1024 | alsa_sound_perror ("Could not set sample rate", err); |
| 1024 | 1025 | ||
| @@ -1123,7 +1124,7 @@ alsa_close (sd) | |||
| 1123 | snd_pcm_sw_params_free (p->swparams); | 1124 | snd_pcm_sw_params_free (p->swparams); |
| 1124 | if (p->handle) | 1125 | if (p->handle) |
| 1125 | { | 1126 | { |
| 1126 | snd_pcm_drain(p->handle); | 1127 | snd_pcm_drain (p->handle); |
| 1127 | snd_pcm_close (p->handle); | 1128 | snd_pcm_close (p->handle); |
| 1128 | } | 1129 | } |
| 1129 | free (p); | 1130 | free (p); |
| @@ -1269,7 +1270,8 @@ alsa_init (sd) | |||
| 1269 | err = snd_pcm_open (&handle, file, SND_PCM_STREAM_PLAYBACK, 0); | 1270 | err = snd_pcm_open (&handle, file, SND_PCM_STREAM_PLAYBACK, 0); |
| 1270 | snd_lib_error_set_handler (NULL); | 1271 | snd_lib_error_set_handler (NULL); |
| 1271 | if (err < 0) | 1272 | if (err < 0) |
| 1272 | return 0; | 1273 | return 0; |
| 1274 | snd_pcm_close (handle); | ||
| 1273 | 1275 | ||
| 1274 | sd->fd = -1; | 1276 | sd->fd = -1; |
| 1275 | sd->open = alsa_open; | 1277 | sd->open = alsa_open; |