summaryrefslogtreecommitdiff
path: root/audio/mad123/patches
diff options
context:
space:
mode:
authorhans <hans>2012-02-15 22:09:31 +0000
committerhans <hans>2012-02-15 22:09:31 +0000
commit1e7dbdbea8e62a04b2e3fdcd237bf04ae8f76db2 (patch)
treea8bfd509271438878469998f74bb35c22fca8d4f /audio/mad123/patches
parentc29624132327ffc91b33915758a4068bd7a34a0d (diff)
downloadpkgsrc-1e7dbdbea8e62a04b2e3fdcd237bf04ae8f76db2.tar.gz
Fix build on SunOS.
Diffstat (limited to 'audio/mad123/patches')
-rw-r--r--audio/mad123/patches/patch-aa13
-rw-r--r--audio/mad123/patches/patch-ab44
-rw-r--r--audio/mad123/patches/patch-mp3__stream.c16
3 files changed, 69 insertions, 4 deletions
diff --git a/audio/mad123/patches/patch-aa b/audio/mad123/patches/patch-aa
index 4d0684a8ab9..0e56b9851bf 100644
--- a/audio/mad123/patches/patch-aa
+++ b/audio/mad123/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $
+$NetBSD: patch-aa,v 1.2 2012/02/15 22:09:31 hans Exp $
--- mad123.c.orig 2005-11-11 18:19:59.000000000 +0000
+++ mad123.c
@@ -10,3 +10,14 @@ $NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/poll.h>
+@@ -33,6 +34,10 @@
+ #include <unistd.h>
+ #include <mad.h>
+
++#ifdef __sun
++#include <sys/stropts.h>
++#endif
++
+ #include "audio_dev.h"
+ #include "mp3_stream.h"
+
diff --git a/audio/mad123/patches/patch-ab b/audio/mad123/patches/patch-ab
index c01c28464ec..fab7aa2f342 100644
--- a/audio/mad123/patches/patch-ab
+++ b/audio/mad123/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $
+$NetBSD: patch-ab,v 1.3 2012/02/15 22:09:31 hans Exp $
--- audio_dev.c.orig 2004-09-22 09:23:43.000000000 +0000
+++ audio_dev.c
@@ -12,7 +12,18 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/wait.h>
-@@ -43,6 +45,10 @@
+@@ -35,6 +35,10 @@
+ #include <unistd.h>
+ #include <mad.h>
+
++#ifdef __sun
++#include <sys/stropts.h>
++#endif
++
+ #include "audio_dev.h"
+
+ #if (BYTE_ORDER == BIG_ENDIAN)
+@@ -43,6 +47,10 @@
#undef WORDS_BIGENDIAN
#endif
@@ -23,7 +34,25 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $
#define PCM_BUFFSIZE ((sizeof(((struct mad_pcm *)0)->samples) / \
sizeof(mad_fixed_t)) * 2)
struct pcm_data {
-@@ -97,8 +103,12 @@ static void audio_convert_dither(unsigne
+@@ -58,7 +66,7 @@ struct pcm_data {
+ #define PCM_LOW_WATER 32
+ struct pcm_buffer {
+ volatile int pb_command;
+- u_int64_t pb_playsamples;
++ uint64_t pb_playsamples;
+ int pb_rate;
+ int pb_nchannels;
+ volatile int pb_purge;
+@@ -74,7 +82,7 @@ struct audio_dev_ctx {
+ int ac_paused;
+ int ac_peerread;
+ int ac_peerwrite;
+- u_int64_t ac_buffersamples;
++ uint64_t ac_buffersamples;
+ void (*ac_readcallback)(void *);
+ void *ac_cbarg;
+ struct pcm_buffer *ac_pcm;
+@@ -97,8 +105,12 @@ static void audio_convert_dither(unsigne
static const struct audio_dev_backend *audio_dev_backends[] = {
@@ -36,3 +65,12 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $
#ifndef NOARTS
&audio_dev_arts,
#endif
+@@ -326,7 +338,7 @@ audio_dev_output(struct audio_dev_ctx *a
+ pd->pd_len = len;
+
+ written /= pd->pd_nchannels;
+- written /= sizeof(u_int16_t);
++ written /= sizeof(uint16_t);
+ ac->ac_pcm->pb_playsamples += written;
+
+ return ((rv >= 0) ? 0 : -1);
diff --git a/audio/mad123/patches/patch-mp3__stream.c b/audio/mad123/patches/patch-mp3__stream.c
new file mode 100644
index 00000000000..33678b511ba
--- /dev/null
+++ b/audio/mad123/patches/patch-mp3__stream.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-mp3__stream.c,v 1.1 2012/02/15 22:09:31 hans Exp $
+
+--- mp3_stream.c.orig 2004-10-21 11:11:42.000000000 +0200
++++ mp3_stream.c 2012-01-11 19:53:46.065401047 +0100
+@@ -41,6 +41,11 @@
+ #endif /* NOTAGLIB */
+ #include <unistd.h> /* Move *after* curl.h, 'cos it's braindamaged */
+
++#ifdef __sun
++#define madvise posix_madvise
++#define MAP_FILE 0
++#endif
++
+ #include "mp3_stream.h"
+
+ static void *mps_file_open(const char *, int);