65 lines
1.9 KiB
Text
65 lines
1.9 KiB
Text
$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
|