summaryrefslogtreecommitdiff
path: root/audio/s3mod/files/patch-dsp.c
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2012-10-12 07:17:33 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2012-10-12 07:17:33 +0000
commitfebc6981ac90d209a5ea7caa555aa86324b02032 (patch)
treef12a0257991b438ed5a2e829ab1c3dcfb839b59f /audio/s3mod/files/patch-dsp.c
parent- convert Makefile header to new two-line format (diff)
Fix build with clang.
Feature safe: yes
Diffstat (limited to 'audio/s3mod/files/patch-dsp.c')
-rw-r--r--audio/s3mod/files/patch-dsp.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/audio/s3mod/files/patch-dsp.c b/audio/s3mod/files/patch-dsp.c
new file mode 100644
index 000000000000..3ebf20cead1f
--- /dev/null
+++ b/audio/s3mod/files/patch-dsp.c
@@ -0,0 +1,54 @@
+--- dsp.c.orig 2012-10-10 23:29:01.000000000 +0800
++++ dsp.c 2012-10-10 23:30:54.000000000 +0800
+@@ -22,20 +22,20 @@
+ * linux_dsp.c - Support for the Linux DSP driver from the Voxware(C) Drivers.
+ */
+
+-#ifdef LINUX
++#ifdef __FreeBSD__
+ #include "config.h"
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+-#include <linux/soundcard.h>
+-#include <bytesex.h>
++#include <sys/soundcard.h>
++#include <machine/endian.h>
+ #include "main.h"
+ #include "dsp.h"
+
+ static int audio;
+
+-int get_dsp_device(void)
++void get_dsp_device(void)
+ {
+ uint32 j;
+
+@@ -68,11 +68,6 @@ int get_dsp_device(void)
+ printf("Unable to get audio blocksize\n");
+ exit(1);
+ }
+- if ((audio_buffer_size < 4096) || (audio_buffer_size > 131072))
+- {
+- printf("Invalid audio buffer size: %d\n",audio_buffer_size);
+- exit(1);
+- }
+ if (!(audio_start_buffer = (uint8 *) malloc(audio_buffer_size)))
+ {
+ printf("Could not get audio buffer memory!\n");
+@@ -80,7 +75,6 @@ int get_dsp_device(void)
+ }
+ audio_end_buffer = &audio_start_buffer[audio_buffer_size];
+ audio_curptr = audio_start_buffer;
+- return;
+ }
+
+ void write_dsp_device(void *buf, int size) {
+@@ -93,5 +87,5 @@ void close_dsp_device() {
+ return;
+ }
+
+-#endif /* ?LINUX */
++#endif /* ?__FreeBSD__ */
+