summaryrefslogtreecommitdiff
path: root/audio/portaudio-devel/patches/patch-ac
blob: 35c845bab4cb6e11bb4928cbe76e370852ad86e6 (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
$NetBSD: patch-ac,v 1.2 2006/06/06 15:48:34 joerg Exp $

--- src/hostapi/oss/pa_unix_oss.c.orig	2006-05-17 08:02:24.000000000 +0000
+++ src/hostapi/oss/pa_unix_oss.c
@@ -42,7 +42,9 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <pthread.h>
+#if !defined(__NetBSD__) && !defined(__DragonFly__)
 #include <alloca.h>
+#endif
 #include <malloc.h>
 #include <assert.h>
 #include <errno.h>
@@ -52,12 +54,15 @@
 #include <limits.h>
 #include <semaphore.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 # include <sys/soundcard.h>
 # define DEVICE_NAME_BASE            "/dev/dsp"
 #elif defined __linux__
 # include <linux/soundcard.h>
 # define DEVICE_NAME_BASE            "/dev/dsp"
+#elif defined(__NetBSD__)
+# include <soundcard.h>
+# define DEVICE_NAME_BASE            "/dev/audio"
 #else
 # include <machine/soundcard.h> /* JH20010905 */
 # define DEVICE_NAME_BASE            "/dev/audio"
@@ -1916,8 +1921,10 @@ static signed long GetStreamWriteAvailab
     PaOssStream *stream = (PaOssStream*)s;
     int delay = 0;
 
+#if !defined(__NetBSD__)
     if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 )
         return paUnanticipatedHostError;
+#endif
     
     return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback );
 }