Mercurial > emacs
changeset 38215:b9fdde642b13
(vox_configure, vox_close): Turn off atimers
around ioctls.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 27 Jun 2001 09:22:36 +0000 |
parents | a4de79556592 |
children | a55e15441c07 |
files | src/sound.c |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sound.c Tue Jun 26 17:10:56 2001 +0000 +++ b/src/sound.c Wed Jun 27 09:22:36 2001 +0000 @@ -31,6 +31,7 @@ #include <sys/types.h> #include <dispextern.h> #include <errno.h> +#include <atimer.h> /* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention sys/soundcard.h. So, let's try whatever's there. */ @@ -411,7 +412,7 @@ { /* Open the sound file. */ s.fd = openp (Fcons (Vdata_directory, Qnil), - attrs[SOUND_FILE], "", &file, 0); + attrs[SOUND_FILE], "", &file, 0); if (s.fd < 0) sound_perror ("Open sound file"); @@ -764,6 +765,8 @@ xassert (sd->fd >= 0); + turn_on_atimers (0); + val = sd->format; if (ioctl (sd->fd, SNDCTL_DSP_SETFMT, &sd->format) < 0 || val != sd->format) @@ -791,6 +794,8 @@ /* This may fail if there is no mixer. Ignore the failure. */ ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &volume); } + + turn_on_atimers (1); } @@ -803,7 +808,9 @@ if (sd->fd >= 0) { /* Flush sound data, and reset the device. */ + turn_on_atimers (0); ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); + turn_on_atimers (1); /* Close the device. */ emacs_close (sd->fd);