pkgsrc/games/maelstrom-x11/patches/patch-ad
wiz 6d5dc9656f Re-import of maelstrom as maelstrom-x11 to better show which version it is;
also, the SDL version seems to be the only one that's under development
right now. Requested in pkg/15583 by Ben Wong.
2002-07-11 13:26:12 +00:00

51 lines
1.4 KiB
Text

$NetBSD: patch-ad,v 1.1.1.1 2002/07/11 13:26:14 wiz Exp $
--- mixer.cpp.orig Thu Dec 5 14:14:44 1996
+++ mixer.cpp Mon Aug 3 01:01:04 1998
@@ -182,7 +182,7 @@
}
/* Do some system specific initialization */
-#ifdef linux
+#if defined(linux) || defined(__NetBSD__)
#ifndef PLAY_DEV_AUDIO /* VoxWare */
if ( ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
if ( complain )
@@ -285,7 +285,7 @@
/* This is necessary so that the sound server stays in sync */
long flags;
flags = fcntl(dsp_fd, F_GETFL, 0);
- flags |= O_SYNC;
+/* flags |= O_SYNC;*/
(void) fcntl(dsp_fd, F_SETFL, flags);
return(0);
@@ -539,7 +539,7 @@
error("Mixer::Play: ALwritesamps (Play) failed!\n");
}
#else /* Normal device write */
-#ifdef sparc
+#if defined(sparc) && !defined(__NetBSD__)
drain_it:
if ( ioctl(dsp_fd, AUDIO_DRAIN, 0) < 0 ) {
if ( errno == EINTR )
@@ -549,13 +549,14 @@
write_frag:
if ( write(dsp_fd, clipped, frag_size*(AUDIO_BITS/8))
!= frag_size*(AUDIO_BITS/8) ) {
- if ( errno == EINTR ) // Interrupted system call...
+ if ( errno == EINTR) // Interrupted system call...
// This should happen (SA_RESTART)
goto write_frag;
- else {
- perror("Mixer: Can't write to audio device");
- return;
- }
+ else
+ if ( errno != EAGAIN) {
+ perror("Mixer: Can't write to audio device");
+ return;
+ }
}
#endif /* Not SGI Source */
} else