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
|
$NetBSD: patch-bb,v 1.5 2007/08/08 20:40:20 joerg Exp $
--- src_sound/dsp_mixxer.c.orig 1998-06-22 10:41:31.000000000 +0000
+++ src_sound/dsp_mixxer.c
@@ -15,14 +15,14 @@
***************************************************************************/
#include <stdio.h>
#include <math.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
-#ifdef Linux
+#if defined(Linux) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/soundcard.h>
-#elif FreeBSD
- #include <machine/soundcard.h>
+#elif defined(__NetBSD__)
+ #include <soundcard.h>
#endif
#include "funktracker_defs.h"
#include "funktracker.h"
@@ -91,7 +91,7 @@ void init_dsp_buffers(void)
register int x;
calc_mix_buffer(funk_info.bpm_rate);
- ioctl(dsp_fp,SNDCTL_DSP_RESET);
+ ioctl(dsp_fp,SNDCTL_DSP_RESET, 0);
for(x = 0;x < mix_buffer_size;x++)
{
*(left_mix_buffer + x) = 0;
@@ -187,7 +187,7 @@ void close_dsp(void)
{
if(dsp_fp != -1)
{
- ioctl(dsp_fp,SNDCTL_DSP_RESET);
+ ioctl(dsp_fp,SNDCTL_DSP_RESET, 0);
close(dsp_fp);
}
}
@@ -247,12 +247,12 @@ int open_dsp(int srate,int prec,int st)
if(dsp_alloc_bufs())
{
printf("Allocated dsp buffers..\n");
- dsp_fp = open("/dev/dsp",O_WRONLY,0);
+ dsp_fp = open(DEVOSSAUDIO,O_WRONLY,0);
if(dsp_fp != -1)
{
int frag;
- printf("Opened /dev/dsp: %d bit %s, %d Hz (%d frames @ %d bytes)\n",
+ printf("Opened " DEVOSSAUDIO ": %d bit %s, %d Hz (%d frames @ %d bytes)\n",
funk_info.precision,
funk_info.stereo == 8 ? "mono" : "stereo",
funk_info.sampling_rate,
@@ -265,7 +265,7 @@ int open_dsp(int srate,int prec,int st)
return 1;
}
else
- printf("Error: Couldn't open /dev/dsp. Program aborted.\n");
+ printf("Error: Couldn't open " DEVOSSAUDIO". Program aborted.\n");
dsp_dealloc_bufs();
}
else
|