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
|
$NetBSD: patch-ac,v 1.2 2006/03/06 22:16:53 joerg Exp $
--- audio_oss.c.orig 2000-12-09 11:12:15.000000000 +0000
+++ audio_oss.c
@@ -12,11 +12,12 @@
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
-#ifndef __FreeBSD__
-#include <linux/soundcard.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/soundcard.h>
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#include <soundcard.h>
#else
-#include <machine/soundcard.h>
-#define SNDCTL_DSP_CHANNELS SNDCTL_DSP_STEREO
+#include <linux/soundcard.h>
#endif
#include "audio.h"
@@ -42,12 +43,12 @@ int audio_oss_open(gpointer data)
if (driver->descriptor==-1)
{
- driver->descriptor=open("/dev/dsp",O_WRONLY);
+ driver->descriptor=open("@DEVOSSAUDIO@",O_WRONLY);
if (driver->descriptor!=-1)
{
int format_mask=0;
- ioctl(driver->descriptor,SNDCTL_DSP_RESET);
+ ioctl(driver->descriptor,SNDCTL_DSP_RESET, 0);
ioctl(driver->descriptor,SNDCTL_DSP_SPEED,&speed);
ioctl(driver->descriptor,SNDCTL_DSP_CHANNELS,&channels);
ioctl(driver->descriptor,SNDCTL_DSP_GETFMTS,&format_mask);
|