changeset 2260:b71d8bee8882

OSS: use SNDCTL_DSP_SYNC, as not all OSS versions have SNDCTL_DSP_RESET. Reported by Michal on the forums.
author William Pitcock <nenolod@atheme.org>
date Fri, 21 Dec 2007 12:17:25 -0600
parents 98fa8fe789a4
children 05c9bec29aaa f51a47e53d4f
files src/OSS/audio.c
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/OSS/audio.c	Fri Dec 21 16:51:56 2007 +0100
+++ b/src/OSS/audio.c	Fri Dec 21 12:17:25 2007 -0600
@@ -494,12 +494,8 @@
         if (do_pause && !paused) {
             do_pause = FALSE;
             paused = TRUE;
-            /*
-             * We lose some data here that is sent to the
-             * soundcard, but not yet played.  I don't
-             * think this is worth fixing.
-             */
-            ioctl(fd, SNDCTL_DSP_RESET, 0);
+
+            ioctl(fd, SNDCTL_DSP_SYNC, 0);
         }
         else if (unpause && paused) {
             unpause = FALSE;
@@ -516,7 +512,7 @@
              * the driver to get fucked up by a reset
              */
 
-            ioctl(fd, SNDCTL_DSP_RESET, 0);
+            ioctl(fd, SNDCTL_DSP_SYNC, 0);
             close(fd);
             fd = open(device_name, O_WRONLY);
             oss_set_audio_params();
@@ -529,7 +525,7 @@
 
     }
 
-    ioctl(fd, SNDCTL_DSP_RESET, 0);
+    ioctl(fd, SNDCTL_DSP_SYNC, 0);
     close(fd);
     g_free(buffer);
     return NULL;
@@ -542,7 +538,7 @@
     struct timeval tv;
     fd_set set;
 
-    ioctl(fd, SNDCTL_DSP_RESET, 0);
+    ioctl(fd, SNDCTL_DSP_SYNC, 0);
     frag = (NFRAGS << 16) | fragsize;
     ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &frag);
     /*