summaryrefslogtreecommitdiff
path: root/sysutils/xcdroast/patches/patch-ad
blob: 0afd3ab2c372c4e3e22b8cc2e2131ce5c057484f (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
$NetBSD: patch-ad,v 1.3 2002/12/02 20:29:49 drochner Exp $

--- src/wavplay.c.orig	Mon Dec  2 20:48:24 2002
+++ src/wavplay.c	Mon Dec  2 20:52:36 2002
@@ -19,6 +19,14 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
+#ifdef __NetBSD__
+#include <sys/ioctl.h>
+# ifdef HAVE_OSS
+#  include <soundcard.h>
+# else
+#  include <sys/audioio.h>
+# endif
+#endif
 #if defined(linux) || defined(__CYGWIN32__)
 # include <getopt.h>
 #endif
@@ -64,8 +72,8 @@
 gint abuf_size;
 guchar *audiobuf;
 
-#if defined(linux) || defined(__FreeBSD__)
-#define DEFAULT_AUDIO_DEVICE "/dev/dsp"
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
+#define DEFAULT_AUDIO_DEVICE "@DEVOSSAUDIO@"
 #elif defined (aix)
 #define DEFAULT_AUDIO_DEVICE ""
 #else
@@ -299,7 +307,7 @@
 #endif
 
 
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
 
 /* open the sound-device of linux and set cd-quality */
 
@@ -350,7 +358,7 @@
 
 #endif
 
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
 
 /* open the sound-device of solaris and set cd-quality */
 
@@ -377,7 +385,7 @@
 	info.play.precision = 16;
 	info.play.encoding = AUDIO_ENCODING_LINEAR;
 	info.play.buffer_size = abuf_size;
-#ifndef __OpenBSD__
+#if !defined(__OpenBSD__) && !defined(__NetBSD__)
 	info.output_muted = 0;
 #endif
 
@@ -678,10 +686,10 @@
 
 	/* the open sets also the global abuf_size-variable */
 
-#if defined(linux) || defined(__FreeBSD__)
+#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS))
 	audio = open_linux_audio(audio_dev);
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun) || defined(__OpenBSD__) || (defined(__NetBSD__) && !defined(HAVE_OSS))
 	audio = open_solaris_audio(audio_dev);
 #endif
 #ifdef aix