blob: cf157ea198d43d9964e5a295e7e99ffb4192c052 (
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
|
$NetBSD: patch-ac,v 1.5 2013/12/15 20:19:08 asau 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,8 +42,10 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <pthread.h>
+#if !defined(__NetBSD__) && !defined(__DragonFly__) && !defined(__FreeBSD__)
#include <alloca.h>
-#include <malloc.h>
+#endif
+#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
@@ -52,12 +54,15 @@
#include <limits.h>
#include <semaphore.h>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__sun)
# 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 );
}
|