changeset 7118:4332922afec4

release /dev/dsp on pause patch by Eric Lammerts <eric@lammerts.org> (and D Richard Felker III <dalias@aerifal.cx>)
author alex
date Wed, 28 Aug 2002 19:37:13 +0000
parents 4e4d3026a1ca
children eec702b048b0
files libao2/ao_oss.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_oss.c	Wed Aug 28 18:38:41 2002 +0000
+++ b/libao2/ao_oss.c	Wed Aug 28 19:37:13 2002 +0000
@@ -225,10 +225,12 @@
 
 // close audio device
 static void uninit(){
+    if(audio_fd == -1) return;
 #ifdef SNDCTL_DSP_RESET
     ioctl(audio_fd, SNDCTL_DSP_RESET, NULL);
 #endif
     close(audio_fd);
+    audio_fd = -1;
 }
 
 // stop playing and empty buffers (for seeking/pause)
@@ -255,13 +257,13 @@
 // stop playing, keep buffers (for pause)
 static void audio_pause()
 {
-    // for now, just call reset();
-    reset();
+    uninit();
 }
 
 // resume playing, after audio_pause()
 static void audio_resume()
 {
+    reset();
 }