summaryrefslogtreecommitdiff
path: root/games/maelstrom/patches/patch-ad
blob: 2a3b2aef2022aa589883a11742d302219b225c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- 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