summaryrefslogtreecommitdiff
path: root/devel/SDL/patches/patch-al
blob: d3cfd7a42bad35d7aaf25918de811b9982387d0f (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
$NetBSD: patch-al,v 1.5 2003/06/04 17:53:13 abs Exp $

--- src/audio/openbsd/SDL_openbsdaudio.c.orig	Wed Mar  6 11:23:02 2002
+++ src/audio/openbsd/SDL_openbsdaudio.c	Wed Jun  4 17:09:16 2003
@@ -37,6 +37,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/audioio.h>
+#include <pthread.h>
 
 #include "SDL_audio.h"
 #include "SDL_error.h"
@@ -46,8 +47,12 @@
 #include "SDL_audiodev_c.h"
 #include "SDL_openbsdaudio.h"
 
-/* The tag name used by OpenBSD audio */
+/* The tag name used by NetBSD/OpenBSD audio */
+#ifdef __NetBSD__
+#define OBSD_DRIVER_NAME         "netbsd"
+#else
 #define OBSD_DRIVER_NAME         "openbsd"
+#endif
 
 /* Open the audio device for playback, and don't block if busy */
 /* #define USE_BLOCKING_WRITES */
@@ -132,7 +137,11 @@
 }
 
 AudioBootStrap OPENBSD_AUDIO_bootstrap = {
+#ifdef __NetBSD__
+	OBSD_DRIVER_NAME, "Native NetBSD audio",
+#else
 	OBSD_DRIVER_NAME, "Native OpenBSD audio",
+#endif
 	Audio_Available, Audio_CreateDevice
 };
 
@@ -140,6 +149,7 @@
 static void
 OBSD_WaitAudio(_THIS)
 {
+#ifdef __OpenBSD__
 	/* Check to see if the thread-parent process is still alive */
 	{ static int cnt = 0;
 		/* Note that this only works with thread implementations 
@@ -151,6 +161,7 @@
 			}
 		}
 	}
+#endif
 
 #ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */
 	/* See if we need to use timed audio synchronization */
@@ -262,20 +273,20 @@
 	return;
     }
 
-    fprintf(stderr,"
-[play/record info]
-buffer size	:   %d bytes
-sample rate	:   %i Hz
-channels	:   %i
-precision	:   %i-bit
-encoding	:   0x%x
-seek		:   %i
-sample count	:   %i
-EOF count	:   %i
-paused		:   %s
-error occured	:   %s
-waiting		:   %s
-active		:   %s
+    fprintf(stderr,"\n\
+[play/record info]\n\
+buffer size	:   %d bytes\n\
+sample rate	:   %i Hz\n\
+channels	:   %i\n\
+precision	:   %i-bit\n\
+encoding	:   0x%x\n\
+seek		:   %i\n\
+sample count	:   %i\n\
+EOF count	:   %i\n\
+paused		:   %s\n\
+error occured	:   %s\n\
+waiting		:   %s\n\
+active		:   %s\n\
 ",
     info.play.buffer_size,
     info.play.sample_rate,
@@ -290,13 +301,13 @@
     info.play.waiting ? "yes" : "no",
     info.play.active ? "yes": "no");
 
-    fprintf(stderr,"
-[audio info]
-monitor_gain	:   %i
-hw block size	:   %d bytes
-hi watermark	:   %i
-lo watermark	:   %i
-audio mode	:   %s
+    fprintf(stderr,"\n\
+[audio info]\n\
+monitor_gain	:   %i\n\
+hw block size	:   %d bytes\n\
+hi watermark	:   %i\n\
+lo watermark	:   %i\n\
+audio mode	:   %s\n\
 ",  
     info.monitor_gain,
     info.blocksize,