summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorrh <rh@pkgsrc.org>2002-05-25 06:28:00 +0000
committerrh <rh@pkgsrc.org>2002-05-25 06:28:00 +0000
commitca3fa3e2c6745e4fc03952501479dd43bbc116f7 (patch)
tree469a6e63c411040fb074560b9ca00427dbb5c59e /audio
parent600024e0089d99440685fb1aabdc7784c6acd349 (diff)
downloadpkgsrc-ca3fa3e2c6745e4fc03952501479dd43bbc116f7.tar.gz
Initial import of mpg123-nas-0.59.18, an mpg123 (mp3 player) variant with
an NAS backend. This closes PR pkg/14317.
Diffstat (limited to 'audio')
-rw-r--r--audio/mpg123-nas/DESCR6
-rw-r--r--audio/mpg123-nas/Makefile66
-rw-r--r--audio/mpg123-nas/PLIST3
-rw-r--r--audio/mpg123-nas/distinfo20
-rw-r--r--audio/mpg123-nas/patches/patch-aa74
-rw-r--r--audio/mpg123-nas/patches/patch-ab23
-rw-r--r--audio/mpg123-nas/patches/patch-ac31
-rw-r--r--audio/mpg123-nas/patches/patch-ad75
-rw-r--r--audio/mpg123-nas/patches/patch-ae16
-rw-r--r--audio/mpg123-nas/patches/patch-af19
-rw-r--r--audio/mpg123-nas/patches/patch-ag123
-rw-r--r--audio/mpg123-nas/patches/patch-ah22
-rw-r--r--audio/mpg123-nas/patches/patch-ai780
-rw-r--r--audio/mpg123-nas/patches/patch-aj42
-rw-r--r--audio/mpg123-nas/patches/patch-ak40
-rw-r--r--audio/mpg123-nas/patches/patch-al40
16 files changed, 1380 insertions, 0 deletions
diff --git a/audio/mpg123-nas/DESCR b/audio/mpg123-nas/DESCR
new file mode 100644
index 00000000000..7a9eb80829d
--- /dev/null
+++ b/audio/mpg123-nas/DESCR
@@ -0,0 +1,6 @@
+mpg123 reads one or more files (or standard input if ``-'' is
+specified) or URLs and plays them to the NAS device (default) or
+outputs them to a specified file or to stdout.
+
+File(s) and/or URL contents are assumed to be MPEG-1.0/2.0 audio
+layer 1, 2, or 3 bit streams.
diff --git a/audio/mpg123-nas/Makefile b/audio/mpg123-nas/Makefile
new file mode 100644
index 00000000000..073642d0c64
--- /dev/null
+++ b/audio/mpg123-nas/Makefile
@@ -0,0 +1,66 @@
+# $NetBSD: Makefile,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+#
+
+DISTNAME= mpg123-0.59r
+PKGNAME= mpg123-nas-0.59.18
+CATEGORIES= audio
+MASTER_SITES= http://www.mpg123.de/mpg123/ \
+ http://www-ti.informatik.uni-tuebingen.de/~hippm/mpg123/
+
+PATCH_SITES= ftp://ftp.kame.net/pub/kame/misc/ \
+ http://www.unix-ag.org/Linux-Alpha/Packages/
+PATCHFILES= mpg123-059r-v6-20000713b.diff.gz l3.diff.gz
+
+MAINTAINER= packages@netbsd.org
+HOMEPAGE= http://www.mpg123.de/
+COMMENT= Command-line player for mpeg layer 1, 2 and 3 audio with NAS output
+
+BUILD_DEFS+= USE_INET6
+DIST_SUBDIR= mpg123
+FILESDIR= ${.CURDIR}/../mpg123/files
+
+CONFLICTS+= mpg123-[0-9]*
+
+USE_X11BASE= # defined
+USE_BUILDLINK_ONLY= # defined
+
+# for OBJECT_FMT
+.include "../../mk/bsd.prefs.mk"
+
+.if (${MACHINE_ARCH} == "i386")
+.if (${OBJECT_FMT} == "ELF")
+ALL_TARGET= netbsd-i386-elf
+.else
+ALL_TARGET= netbsd-i386
+.endif
+.elif (${MACHINE_ARCH} == "arm32")
+ALL_TARGET= netbsd-arm32
+.elif (${MACHINE_ARCH} == "m68k")
+ALL_TARGET= netbsd-m68k
+.else
+ALL_TARGET= ${LOWER_OPSYS}
+.endif
+
+.if ${OPSYS} == "SunOS"
+ALL_TARGET= solaris-gcc
+.endif
+
+.if defined(USE_INET6) && ${USE_INET6} == "YES"
+CPPFLAGS+= -DINET6
+.endif
+
+MAKE_FLAGS+= PREFIX="${PREFIX}"
+
+pre-patch:
+ ${LN} -s . ${WRKSRC}/mpg123
+
+post-patch:
+ ${RM} -f ${WRKSRC}/mpg123
+ ${CP} ${FILESDIR}/decode_i586_.s ${WRKSRC}/
+ cd ${WRKSRC} ; ${MV} decode_i586.s decode_i586.s.orig ;\
+ ${SED} \
+ -e 's@^/@#/@g' \
+ <decode_i586.s.orig >decode_i586.s
+
+.include "../../audio/nas/buildlink.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/audio/mpg123-nas/PLIST b/audio/mpg123-nas/PLIST
new file mode 100644
index 00000000000..76569af1a05
--- /dev/null
+++ b/audio/mpg123-nas/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+bin/mpg123
+man/man1/mpg123.1
diff --git a/audio/mpg123-nas/distinfo b/audio/mpg123-nas/distinfo
new file mode 100644
index 00000000000..342b9214b07
--- /dev/null
+++ b/audio/mpg123-nas/distinfo
@@ -0,0 +1,20 @@
+$NetBSD: distinfo,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+SHA1 (mpg123/mpg123-0.59r.tar.gz) = c32fe242f4506d218bd19a51a4034da9fdc79493
+Size (mpg123/mpg123-0.59r.tar.gz) = 159028 bytes
+SHA1 (mpg123/mpg123-059r-v6-20000713b.diff.gz) = fab11489b6a1ab79d6c29787161f1c05e492dc0b
+Size (mpg123/mpg123-059r-v6-20000713b.diff.gz) = 5600 bytes
+SHA1 (mpg123/l3.diff.gz) = 657c83289c565a246275dcab378f9c9acf5f9f9e
+Size (mpg123/l3.diff.gz) = 689 bytes
+SHA1 (patch-aa) = 1c9cdf05eeba7c0e10dc720e27de6c5b0e818322
+SHA1 (patch-ab) = ffc387d93f0f2832e49796c80be26e908defa3a7
+SHA1 (patch-ac) = 06a5037e27ddd4cc34e5348c09e702f9740173c5
+SHA1 (patch-ad) = e9b2b874a95a67139c7d48e74492eb64dfa815f0
+SHA1 (patch-ae) = 9ac13c978bdf498cbd5e9fa0777a51559fdb2403
+SHA1 (patch-af) = 309075bc6fd4b689b711f0ae84f2e5c829609452
+SHA1 (patch-ag) = c27b6a441573939dc23268a6937905d038d6a66b
+SHA1 (patch-ah) = e1419bc6d25360d0825041028b6b3f485bcf5f43
+SHA1 (patch-ai) = da0d329fd6cd039db27cffcc1063144e1e56943f
+SHA1 (patch-aj) = 910b2834c34e617c492a3c72e4d2185d3eb53ecc
+SHA1 (patch-ak) = b30898cff26859eca0d23ea8cfdd461920b978a8
+SHA1 (patch-al) = 88dec640d40e6a3f1828096a4ff7b5a4dbd0a222
diff --git a/audio/mpg123-nas/patches/patch-aa b/audio/mpg123-nas/patches/patch-aa
new file mode 100644
index 00000000000..4ac41a1af0c
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-aa
@@ -0,0 +1,74 @@
+$NetBSD: patch-aa,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- Makefile.orig Mon Feb 26 10:58:56 2001
++++ Makefile
+@@ -54,6 +54,10 @@
+ @echo "make aix-tk3play IBM AIX"
+ @echo "make os2 IBM OS/2"
+ @echo "make netbsd NetBSD"
++ @echo "make netbsd-arm32 NetBSD for strongarm"
++ @echo "make netbsd-i386 NetBSD optimized for i386"
++ @echo "make netbsd-i386-elf NetBSD optimized for i386, ELF format"
++ @echo "make netbsd-m68k NetBSD optimized for m68k"
+ @echo "make bsdos BSDI BSD/OS"
+ @echo "make bsdos4 BSDI BSD/OS 4.0"
+ @echo "make bsdos-nas BSDI BSD/OS with NAS support"
+@@ -377,6 +381,34 @@
+ -funroll-all-loops -finline-functions' \
+ mpg123-make
+
++netbsd-i386-elf:
++ $(MAKE) CC=cc AUDIO_LIB='-laudio -lXt' \
++ OBJECTS='decode_i386.o dct64_i386.o decode_i586.o \
++ audio_nas.o term.o' \
++ CFLAGS='$(CFLAGS) -Wall -ansi -pedantic -O4 -fomit-frame-pointer \
++ -funroll-all-loops -ffast-math -DROT_I386 \
++ -DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DUSE_MMAP \
++ -DREAD_MMAP -DNAS -DNETBSD -DTERM_CONTROL' \
++ mpg123-make
++
++netbsd-m68k:
++ $(MAKE) CC=cc AUDIO_LIB='-laudio -lXt' \
++ OBJECTS='decode.o dct64.o audio_nas.o term.o' \
++ CFLAGS='$(CFLAGS) -Wall -ansi -pedantic -O3 -fomit-frame-pointer \
++ -ffast-math -DREAL_IS_FLOAT \
++ -DUSE_MMAP -DNAS -DNETBSD -DM68K_ASSEM -DTERM_CONTROL' \
++ mpg123-make
++
++netbsd-arm32:
++ $(MAKE) CC=cc AUDIO_LIB='-laudio -lXt' \
++ OBJECTS='decode.o dct64.o audio_nas.o term.o' \
++ CFLAGS='$(CFLAGS) -Wall -O6 -fomit-frame-pointer \
++ -funroll-all-loops -finline-functions -ffast-math \
++ -march=armv4 -mtune=strongarm -mcpu=strongarm \
++ -DREAL_IS_FIXED -DUSE_MMAP -DREAD_MMAP -DTERM_CONTROL \
++ -DNAS -DNETBSD' \
++ mpg123-make
++
+ solaris-gcc-esd:
+ $(MAKE) CC=gcc LDFLAGS='-lsocket -lnsl' \
+ AUDIO_LIB='-lesd -lresolv' \
+@@ -496,18 +528,18 @@
+
+ netbsd:
+ $(MAKE) CC=cc LDFLAGS= \
+- OBJECTS='decode.o dct64.o audio_sun.o' \
++ OBJECTS='decode.o dct64.o audio_nas.o term.o' AUDIO_LIB='-laudio -lXt' \
+ CFLAGS='$(CFLAGS) -Wall -ansi -pedantic -O3 -fomit-frame-pointer \
+ -funroll-all-loops -ffast-math \
+- -DREAL_IS_FLOAT -DUSE_MMAP -DNETBSD' \
++ -DREAL_IS_FLOAT -DUSE_MMAP -DTERM_CONTROL -DNAS -DNETBSD' \
+ mpg123-make
+
+ netbsd-i386:
+ $(MAKE) CC=cc LDFLAGS= \
+- OBJECTS='decode_i386.o dct64_i386.o audio_sun.o' \
+- CFLAGS='$(CFLAGS) -Wall -ansi -pedantic -O4 -m486 -fomit-frame-pointer \
++ OBJECTS='decode_i386.o dct64_i386.o audio_nas.o term.o' AUDIO_LIB='-laudio -lXt' \
++ CFLAGS='$(CFLAGS) -Wall -ansi -pedantic -O4 -fomit-frame-pointer \
+ -funroll-all-loops -ffast-math -DROT_I386 \
+- -DI386_ASSEM -DREAL_IS_FLOAT -DUSE_MMAP -DNETBSD' \
++ -DI386_ASSEM -DREAL_IS_FLOAT -DUSE_MMAP -DTERM_CONTROL -DNAS -DNETBSD' \
+ mpg123-make
+
+ bsdos:
diff --git a/audio/mpg123-nas/patches/patch-ab b/audio/mpg123-nas/patches/patch-ab
new file mode 100644
index 00000000000..abc92aaa9c0
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ab
@@ -0,0 +1,23 @@
+$NetBSD: patch-ab,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- mpg123.c.orig Tue Jun 15 22:21:36 1999
++++ mpg123.c Sun Jul 18 21:20:19 1999
+@@ -177,6 +177,9 @@
+ _exit(0);
+ default: /* parent */
+ xfermem_init_writer (buffermem);
++ if (xfermem_block(XF_WRITER, buffermem) == XF_CMD_TERMINATE) {
++ intflag = TRUE;
++ }
+ param.outmode = DECODE_BUFFER;
+ }
+ }
+@@ -918,7 +921,7 @@
+ {
+ const char *term_type;
+ term_type = getenv("TERM");
+- if (!strcmp(term_type,"xterm"))
++ if (term_type && !strcmp(term_type,"xterm"))
+ {
+ fprintf(stderr, "\033]0;%s\007", filename);
+ }
diff --git a/audio/mpg123-nas/patches/patch-ac b/audio/mpg123-nas/patches/patch-ac
new file mode 100644
index 00000000000..d101ad71ad3
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ac
@@ -0,0 +1,31 @@
+$NetBSD: patch-ac,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- audio_sun.c.orig Thu Feb 4 13:22:34 1999
++++ audio_sun.c Mon Sep 27 09:17:00 1999
+@@ -17,6 +17,8 @@
+
+ #include "mpg123.h"
+
++extern int outburst;
++
+ #ifndef SPARCLINUX
+ #include <sys/filio.h>
+ #ifdef SUNOS
+@@ -78,6 +80,17 @@
+ }
+
+ #ifndef NETBSD
++ AUDIO_INITINFO(&ainfo);
++ if(ioctl(ai->fn, AUDIO_GETINFO, &ainfo) == -1)
++ return -1;
++#ifdef SOLARIS
++ outburst = MAXOUTBURST;
++#else
++ outburst = ainfo.blocksize;
++#endif
++ if(outburst > MAXOUTBURST)
++ outburst = MAXOUTBURST;
++
+ AUDIO_INITINFO(&ainfo);
+
+ if(ai->output > 0)
diff --git a/audio/mpg123-nas/patches/patch-ad b/audio/mpg123-nas/patches/patch-ad
new file mode 100644
index 00000000000..c39931c00aa
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ad
@@ -0,0 +1,75 @@
+$NetBSD: patch-ad,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- dct64.c.orig Sat Sep 20 21:16:04 1997
++++ dct64.c Thu Aug 12 23:28:33 1999
+@@ -29,7 +29,7 @@
+ for(i=15;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=15;i>=0;i--)
+- *bs++ = (*--b2 - *b1++) * *--costab;
++ *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
+
+ b1 = bufs;
+ costab = pnts[1]+8;
+@@ -39,13 +39,13 @@
+ for(i=7;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=7;i>=0;i--)
+- *bs++ = (*--b2 - *b1++) * *--costab;
++ *bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
+ b2 += 32;
+ costab += 8;
+ for(i=7;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=7;i>=0;i--)
+- *bs++ = (*b1++ - *--b2) * *--costab;
++ *bs++ = REAL_MUL((*b1++ - *--b2), *--costab);
+ b2 += 32;
+ }
+
+@@ -58,12 +58,12 @@
+ for(i=3;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=3;i>=0;i--)
+- *bs++ = (*--b2 - *b1++) * costab[i];
++ *bs++ = REAL_MUL((*--b2 - *b1++), costab[i]);
+ b2 += 16;
+ for(i=3;i>=0;i--)
+ *bs++ = (*b1++ + *--b2);
+ for(i=3;i>=0;i--)
+- *bs++ = (*b1++ - *--b2) * costab[i];
++ *bs++ = REAL_MUL((*b1++ - *--b2), costab[i]);
+ b2 += 16;
+ }
+
+@@ -75,13 +75,13 @@
+ {
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = (*b1++ + *--b2);
+- *bs++ = (*--b2 - *b1++) * costab[1];
+- *bs++ = (*--b2 - *b1++) * costab[0];
++ *bs++ = REAL_MUL((*--b2 - *b1++), costab[1]);
++ *bs++ = REAL_MUL((*--b2 - *b1++), costab[0]);
+ b2 += 8;
+ *bs++ = (*b1++ + *--b2);
+ *bs++ = (*b1++ + *--b2);
+- *bs++ = (*b1++ - *--b2) * costab[1];
+- *bs++ = (*b1++ - *--b2) * costab[0];
++ *bs++ = REAL_MUL((*b1++ - *--b2), costab[1]);
++ *bs++ = REAL_MUL((*b1++ - *--b2), costab[0]);
+ b2 += 8;
+ }
+ bs = bufs;
+@@ -92,10 +92,10 @@
+ real v0,v1;
+ v0=*b1++; v1 = *b1++;
+ *bs++ = (v0 + v1);
+- *bs++ = (v0 - v1) * (*costab);
++ *bs++ = REAL_MUL((v0 - v1), (*costab));
+ v0=*b1++; v1 = *b1++;
+ *bs++ = (v0 + v1);
+- *bs++ = (v1 - v0) * (*costab);
++ *bs++ = REAL_MUL((v1 - v0), (*costab));
+ }
+
+ }
diff --git a/audio/mpg123-nas/patches/patch-ae b/audio/mpg123-nas/patches/patch-ae
new file mode 100644
index 00000000000..8af0ff38718
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ae
@@ -0,0 +1,16 @@
+$NetBSD: patch-ae,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- dct64_i486.c.orig Thu Nov 19 21:42:36 1998
++++ dct64_i486.c Mon Aug 16 01:49:16 1999
+@@ -47,7 +47,11 @@
+ #define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]=(expr)
+ #define MUL(a,b) (((a)*(b)) >> 15)
+ #define MULL(a,b) (((long long)(a)*(long long)(b)) >> 15)
++#ifdef REAL_IS_FIXED
++#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR)
++#else
+ #define TOINT(a) ((int)((a)*32768.0))
++#endif
+
+ void dct64_1_486(int *out0,int *out1,int *b1,int *b2)
+ {
diff --git a/audio/mpg123-nas/patches/patch-af b/audio/mpg123-nas/patches/patch-af
new file mode 100644
index 00000000000..72168fa9909
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-af
@@ -0,0 +1,19 @@
+$NetBSD: patch-af,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- audio.c.orig Mon Nov 23 08:16:24 1998
++++ audio.c Wed Apr 7 16:23:29 1999
+@@ -81,10 +81,14 @@
+ k1 = NUM_RATES;
+ }
+
++#ifndef NETBSD
+ if(audio_open(&ai1) < 0) {
+ perror("audio");
+ exit(1);
+ }
++#else
++ audio_open(&ai1);
++#endif
+
+ for(i=0;i<NUM_CHANNELS;i++) {
+ for(j=0;j<NUM_RATES;j++) {
diff --git a/audio/mpg123-nas/patches/patch-ag b/audio/mpg123-nas/patches/patch-ag
new file mode 100644
index 00000000000..170fb16f5f5
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ag
@@ -0,0 +1,123 @@
+$NetBSD: patch-ag,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- decode.c.orig Tue Jan 26 23:47:05 1999
++++ decode.c Tue Oct 12 01:19:18 1999
+@@ -13,9 +13,9 @@
+ #include "mpg123.h"
+
+ #define WRITE_SAMPLE(samples,sum,clip) \
+- if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \
+- else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \
+- else { *(samples) = sum; }
++ if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
++ else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
++ else { *(samples) = REAL_TO_SHORT(sum); }
+
+ int synth_1to1_8bit(real *bandPtr,int channel,unsigned char *samples,int *pnt)
+ {
+@@ -156,36 +156,36 @@
+ for (j=16;j;j--,window+=0x10,samples+=step)
+ {
+ real sum;
+- sum = *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
+- sum += *window++ * *b0++;
+- sum -= *window++ * *b0++;
++ sum = REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
++ sum += REAL_MUL(*window++, *b0++);
++ sum -= REAL_MUL(*window++, *b0++);
+
+ WRITE_SAMPLE(samples,sum,clip);
+ }
+
+ {
+ real sum;
+- sum = window[0x0] * b0[0x0];
+- sum += window[0x2] * b0[0x2];
+- sum += window[0x4] * b0[0x4];
+- sum += window[0x6] * b0[0x6];
+- sum += window[0x8] * b0[0x8];
+- sum += window[0xA] * b0[0xA];
+- sum += window[0xC] * b0[0xC];
+- sum += window[0xE] * b0[0xE];
++ sum = REAL_MUL(window[0x0], b0[0x0]);
++ sum += REAL_MUL(window[0x2], b0[0x2]);
++ sum += REAL_MUL(window[0x4], b0[0x4]);
++ sum += REAL_MUL(window[0x6], b0[0x6]);
++ sum += REAL_MUL(window[0x8], b0[0x8]);
++ sum += REAL_MUL(window[0xA], b0[0xA]);
++ sum += REAL_MUL(window[0xC], b0[0xC]);
++ sum += REAL_MUL(window[0xE], b0[0xE]);
+ WRITE_SAMPLE(samples,sum,clip);
+ b0-=0x10,window-=0x20,samples+=step;
+ }
+@@ -194,22 +194,22 @@
+ for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step)
+ {
+ real sum;
+- sum = -*(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
+- sum -= *(--window) * *b0++;
++ sum = -REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
++ sum -= REAL_MUL(*(--window), *b0++);
+
+ WRITE_SAMPLE(samples,sum,clip);
+ }
+@@ -219,5 +219,3 @@
+
+ return clip;
+ }
+-
+-
diff --git a/audio/mpg123-nas/patches/patch-ah b/audio/mpg123-nas/patches/patch-ah
new file mode 100644
index 00000000000..8e31dff530c
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ah
@@ -0,0 +1,22 @@
+$NetBSD: patch-ah,v 1.1.1.1 2002/05/25 06:28:00 rh Exp $
+
+--- equalizer.c.orig Tue Feb 2 03:47:35 1999
++++ equalizer.c Mon Aug 16 02:08:31 1999
+@@ -13,7 +13,7 @@
+
+ if(equalfile) {
+ for(i=0;i<32;i++)
+- bandPtr[i] *= equalizer[channel][i];
++ bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]);
+ }
+
+ /* if(param.equalizer & 0x2) {
+@@ -28,7 +28,7 @@
+ {
+ int i;
+ for(i=0;i<576;i++) {
+- bandPtr[i] *= equalizerband[channel][i];
++ bandPtr[i] = REAL_MUL(bandPtr[i], equalizerband[channel][i]);
+ }
+ }
+
diff --git a/audio/mpg123-nas/patches/patch-ai b/audio/mpg123-nas/patches/patch-ai
new file mode 100644
index 00000000000..2599186f63f
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ai
@@ -0,0 +1,780 @@
+$NetBSD: patch-ai,v 1.1.1.1 2002/05/25 06:28:01 rh Exp $
+
+--- layer3.c.orig Thu Apr 22 01:25:18 1999
++++ layer3.c Mon Aug 16 02:02:01 1999
+@@ -109,54 +109,54 @@
+ int i,j,k,l;
+
+ for(i=-256;i<118+4;i++)
+- gainpow2[i+256] = pow((double)2.0,-0.25 * (double) (i+210) );
++ gainpow2[i+256] = DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210) ));
+
+ for(i=0;i<8207;i++)
+- ispow[i] = pow((double)i,(double)4.0/3.0);
++ ispow[i] = DOUBLE_TO_REAL(pow((double)i,(double)4.0/3.0));
+
+ for (i=0;i<8;i++) {
+ static double Ci[8]={-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
+ double sq=sqrt(1.0+Ci[i]*Ci[i]);
+- aa_cs[i] = 1.0/sq;
+- aa_ca[i] = Ci[i]/sq;
++ aa_cs[i] = DOUBLE_TO_REAL(1.0/sq);
++ aa_ca[i] = DOUBLE_TO_REAL(Ci[i]/sq);
+ }
+
+ for(i=0;i<18;i++) {
+- win[0][i] = win[1][i] = 0.5 * sin( M_PI / 72.0 * (double) (2*(i+0) +1) ) / cos ( M_PI * (double) (2*(i+0) +19) / 72.0 );
+- win[0][i+18] = win[3][i+18] = 0.5 * sin( M_PI / 72.0 * (double) (2*(i+18)+1) ) / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 );
++ win[0][i] = win[1][i] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 72.0 * (double) (2*(i+0) +1) ) / cos ( M_PI * (double) (2*(i+0) +19) / 72.0 ));
++ win[0][i+18] = win[3][i+18] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 72.0 * (double) (2*(i+18)+1) ) / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 ));
+ }
+ for(i=0;i<6;i++) {
+- win[1][i+18] = 0.5 / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 );
+- win[3][i+12] = 0.5 / cos ( M_PI * (double) (2*(i+12)+19) / 72.0 );
+- win[1][i+24] = 0.5 * sin( M_PI / 24.0 * (double) (2*i+13) ) / cos ( M_PI * (double) (2*(i+24)+19) / 72.0 );
+- win[1][i+30] = win[3][i] = 0.0;
+- win[3][i+6 ] = 0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*(i+6 )+19) / 72.0 );
++ win[1][i+18] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 ));
++ win[3][i+12] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+12)+19) / 72.0 ));
++ win[1][i+24] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+13) ) / cos ( M_PI * (double) (2*(i+24)+19) / 72.0 ));
++ win[1][i+30] = win[3][i] = DOUBLE_TO_REAL(0.0);
++ win[3][i+6 ] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*(i+6 )+19) / 72.0 ));
+ }
+
+ for(i=0;i<9;i++)
+- COS9[i] = cos( M_PI / 18.0 * (double) i);
++ COS9[i] = DOUBLE_TO_REAL(cos( M_PI / 18.0 * (double) i));
+
+ for(i=0;i<9;i++)
+- tfcos36[i] = 0.5 / cos ( M_PI * (double) (i*2+1) / 36.0 );
++ tfcos36[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 36.0 ));
+ for(i=0;i<3;i++)
+- tfcos12[i] = 0.5 / cos ( M_PI * (double) (i*2+1) / 12.0 );
++ tfcos12[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 12.0 ));
+
+- COS6_1 = cos( M_PI / 6.0 * (double) 1);
+- COS6_2 = cos( M_PI / 6.0 * (double) 2);
++ COS6_1 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 1));
++ COS6_2 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 2));
+
+ #ifdef NEW_DCT9
+- cos9[0] = cos(1.0*M_PI/9.0);
+- cos9[1] = cos(5.0*M_PI/9.0);
+- cos9[2] = cos(7.0*M_PI/9.0);
+- cos18[0] = cos(1.0*M_PI/18.0);
+- cos18[1] = cos(11.0*M_PI/18.0);
+- cos18[2] = cos(13.0*M_PI/18.0);
++ cos9[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/9.0));
++ cos9[1] = DOUBLE_TO_REAL(cos(5.0*M_PI/9.0));
++ cos9[2] = DOUBLE_TO_REAL(cos(7.0*M_PI/9.0));
++ cos18[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/18.0));
++ cos18[1] = DOUBLE_TO_REAL(cos(11.0*M_PI/18.0));
++ cos18[2] = DOUBLE_TO_REAL(cos(13.0*M_PI/18.0));
+ #endif
+
+ for(i=0;i<12;i++) {
+- win[2][i] = 0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*i+7) / 24.0 );
++ win[2][i] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*i+7) / 24.0 ));
+ for(j=0;j<6;j++)
+- COS1[i][j] = cos( M_PI / 24.0 * (double) ((2*i+7)*(2*j+1)) );
++ COS1[i][j] = DOUBLE_TO_REAL(cos( M_PI / 24.0 * (double) ((2*i+7)*(2*j+1)) ));
+ }
+
+ for(j=0;j<4;j++) {
+@@ -169,10 +169,10 @@
+
+ for(i=0;i<16;i++) {
+ double t = tan( (double) i * M_PI / 12.0 );
+- tan1_1[i] = t / (1.0+t);
+- tan2_1[i] = 1.0 / (1.0 + t);
+- tan1_2[i] = M_SQRT2 * t / (1.0+t);
+- tan2_2[i] = M_SQRT2 / (1.0 + t);
++ tan1_1[i] = DOUBLE_TO_REAL(t / (1.0+t));
++ tan2_1[i] = DOUBLE_TO_REAL(1.0 / (1.0 + t));
++ tan1_2[i] = DOUBLE_TO_REAL(M_SQRT2 * t / (1.0+t));
++ tan2_2[i] = DOUBLE_TO_REAL(M_SQRT2 / (1.0 + t));
+
+ for(j=0;j<2;j++) {
+ double base = pow(2.0,-0.25*(j+1.0));
+@@ -183,10 +183,10 @@
+ else
+ p2 = pow(base,i*0.5);
+ }
+- pow1_1[j][i] = p1;
+- pow2_1[j][i] = p2;
+- pow1_2[j][i] = M_SQRT2 * p1;
+- pow2_2[j][i] = M_SQRT2 * p2;
++ pow1_1[j][i] = DOUBLE_TO_REAL(p1);
++ pow2_1[j][i] = DOUBLE_TO_REAL(p2);
++ pow1_2[j][i] = DOUBLE_TO_REAL(M_SQRT2 * p1);
++ pow2_2[j][i] = DOUBLE_TO_REAL(M_SQRT2 * p2);
+ }
+ }
+
+@@ -713,22 +713,22 @@
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(mask < 0)
+- *xrpnt = -ispow[x] * v;
++ *xrpnt = REAL_MUL(-ispow[x], v);
+ else
+- *xrpnt = ispow[x] * v;
++ *xrpnt = REAL_MUL(ispow[x], v);
+ mask <<= 1;
+ }
+ else if(x) {
+ max[lwin] = cb;
+ if(mask < 0)
+- *xrpnt = -ispow[x] * v;
++ *xrpnt = REAL_MUL(-ispow[x], v);
+ else
+- *xrpnt = ispow[x] * v;
++ *xrpnt = REAL_MUL(ispow[x], v);
+ num--;
+ mask <<= 1;
+ }
+ else
+- *xrpnt = 0.0;
++ *xrpnt = DOUBLE_TO_REAL(0.0);
+ xrpnt += step;
+ if(y == 15 && h->linbits) {
+ max[lwin] = cb;
+@@ -737,22 +737,22 @@
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(mask < 0)
+- *xrpnt = -ispow[y] * v;
++ *xrpnt = REAL_MUL(-ispow[y], v);
+ else
+- *xrpnt = ispow[y] * v;
++ *xrpnt = REAL_MUL(ispow[y], v);
+ mask <<= 1;
+ }
+ else if(y) {
+ max[lwin] = cb;
+ if(mask < 0)
+- *xrpnt = -ispow[y] * v;
++ *xrpnt = REAL_MUL(-ispow[y], v);
+ else
+- *xrpnt = ispow[y] * v;
++ *xrpnt = REAL_MUL(ispow[y], v);
+ num--;
+ mask <<= 1;
+ }
+ else
+- *xrpnt = 0.0;
++ *xrpnt = DOUBLE_TO_REAL(0.0);
+ xrpnt += step;
+ }
+ }
+@@ -804,7 +804,7 @@
+ mask <<= 1;
+ }
+ else
+- *xrpnt = 0.0;
++ *xrpnt = DOUBLE_TO_REAL(0.0);
+ xrpnt += step;
+ }
+ }
+@@ -812,8 +812,8 @@
+ if(lwin < 3) { /* short band? */
+ while(1) {
+ for(;mc > 0;mc--) {
+- *xrpnt = 0.0; xrpnt += 3; /* short band -> step=3 */
+- *xrpnt = 0.0; xrpnt += 3;
++ *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; /* short band -> step=3 */
++ *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3;
+ }
+ if(m >= me)
+ break;
+@@ -887,22 +887,22 @@
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(mask < 0)
+- *xrpnt++ = -ispow[x] * v;
++ *xrpnt++ = REAL_MUL(-ispow[x], v);
+ else
+- *xrpnt++ = ispow[x] * v;
++ *xrpnt++ = REAL_MUL(ispow[x], v);
+ mask <<= 1;
+ }
+ else if(x) {
+ max = cb;
+ if(mask < 0)
+- *xrpnt++ = -ispow[x] * v;
++ *xrpnt++ = REAL_MUL(-ispow[x], v);
+ else
+- *xrpnt++ = ispow[x] * v;
++ *xrpnt++ = REAL_MUL(ispow[x], v);
+ num--;
+ mask <<= 1;
+ }
+ else
+- *xrpnt++ = 0.0;
++ *xrpnt++ = DOUBLE_TO_REAL(0.0);
+
+ if (y == 15 && h->linbits) {
+ max = cb;
+@@ -911,22 +911,22 @@
+ num -= h->linbits+1;
+ mask <<= h->linbits;
+ if(mask < 0)
+- *xrpnt++ = -ispow[y] * v;
++ *xrpnt++ = REAL_MUL(-ispow[y], v);
+ else
+- *xrpnt++ = ispow[y] * v;
++ *xrpnt++ = REAL_MUL(ispow[y], v);
+ mask <<= 1;
+ }
+ else if(y) {
+ max = cb;
+ if(mask < 0)
+- *xrpnt++ = -ispow[y] * v;
++ *xrpnt++ = REAL_MUL(-ispow[y], v);
+ else
+- *xrpnt++ = ispow[y] * v;
++ *xrpnt++ = REAL_MUL(ispow[y], v);
+ num--;
+ mask <<= 1;
+ }
+ else
+- *xrpnt++ = 0.0;
++ *xrpnt++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+
+@@ -974,7 +974,7 @@
+ mask <<= 1;
+ }
+ else
+- *xrpnt++ = 0.0;
++ *xrpnt++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+
+@@ -987,7 +987,7 @@
+ num = 0;
+
+ while(xrpnt < &xr[SBLIMIT][0])
+- *xrpnt++ = 0.0;
++ *xrpnt++ = DOUBLE_TO_REAL(0.0);
+
+ while( part2remain > 16 ) {
+ getbits(16); /* Dismiss stuffing Bits */
+@@ -1065,8 +1065,8 @@
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for (; sb > 0; sb--,idx+=3) {
+ real v = xr[0][idx];
+- xr[0][idx] = v * t1;
+- xr[1][idx] = v * t2;
++ xr[0][idx] = REAL_MUL(v, t1);
++ xr[1][idx] = REAL_MUL(v, t2);
+ }
+ }
+ }
+@@ -1087,8 +1087,8 @@
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for ( ; sb > 0; sb--,idx+=3 ) {
+ real v = xr[0][idx];
+- xr[0][idx] = v * t1;
+- xr[1][idx] = v * t2;
++ xr[0][idx] = REAL_MUL(v, t1);
++ xr[1][idx] = REAL_MUL(v, t2);
+ }
+ }
+ } /* end for(lwin; .. ; . ) */
+@@ -1108,8 +1108,8 @@
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for ( ; sb > 0; sb--,idx++) {
+ real v = xr[0][idx];
+- xr[0][idx] = v * t1;
+- xr[1][idx] = v * t2;
++ xr[0][idx] = REAL_MUL(v, t1);
++ xr[1][idx] = REAL_MUL(v, t2);
+ }
+ }
+ else
+@@ -1128,8 +1128,8 @@
+ t1 = tab1[is_p]; t2 = tab2[is_p];
+ for ( ; sb > 0; sb--,idx++) {
+ real v = xr[0][idx];
+- xr[0][idx] = v * t1;
+- xr[1][idx] = v * t2;
++ xr[0][idx] = REAL_MUL(v, t1);
++ xr[1][idx] = REAL_MUL(v, t2);
+ }
+ }
+ else
+@@ -1143,8 +1143,8 @@
+
+ for ( sb = bi->longDiff[21]; sb > 0; sb--,idx++ ) {
+ real v = xr[0][idx];
+- xr[0][idx] = v * t1;
+- xr[1][idx] = v * t2;
++ xr[0][idx] = REAL_MUL(v, t1);
++ xr[1][idx] = REAL_MUL(v, t2);
+ }
+ }
+ } /* ... */
+@@ -1177,8 +1177,8 @@
+ for(ss=7;ss>=0;ss--)
+ { /* upper and lower butterfly inputs */
+ register real bu = *--xr2,bd = *xr1;
+- *xr2 = (bu * (*cs) ) - (bd * (*ca) );
+- *xr1++ = (bd * (*cs++) ) + (bu * (*ca++) );
++ *xr2 = REAL_MUL(bu, *cs) - REAL_MUL(bd, *ca);
++ *xr1++ = REAL_MUL(bd, *cs++) + REAL_MUL(bu, *ca++);
+ }
+ }
+ }
+@@ -1252,8 +1252,8 @@
+ {
+ real t0, t1, t2;
+
+- t0 = COS6_2 * (in[8] + in[16] - in[4]);
+- t1 = COS6_2 * in[12];
++ t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
++ t1 = REAL_MUL(COS6_2, in[12]);
+
+ t3 = in[0];
+ t2 = t3 - t1 - t1;
+@@ -1261,16 +1261,16 @@
+ tmp[4] = t2 + t0 + t0;
+ t3 += t1;
+
+- t2 = COS6_1 * (in[10] + in[14] - in[2]);
++ t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
+ tmp[1] -= t2;
+ tmp[7] += t2;
+ }
+ {
+ real t0, t1, t2;
+
+- t0 = cos9[0] * (in[4] + in[8] );
+- t1 = cos9[1] * (in[8] - in[16]);
+- t2 = cos9[2] * (in[4] + in[16]);
++ t0 = REAL_MUL(cos9[0], (in[4] + in[8] ));
++ t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
++ t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
+
+ tmp[2] = tmp[6] = t3 - t0 - t2;
+ tmp[0] = tmp[8] = t3 + t0 + t1;
+@@ -1280,9 +1280,9 @@
+ {
+ real t1, t2, t3;
+
+- t1 = cos18[0] * (in[2] + in[10]);
+- t2 = cos18[1] * (in[10] - in[14]);
+- t3 = COS6_1 * in[6];
++ t1 = REAL_MUL(cos18[0], (in[2] + in[10]));
++ t2 = REAL_MUL(cos18[1], (in[10] - in[14]));
++ t3 = REAL_MUL(COS6_1, in[6]);
+
+ {
+ real t0 = t1 + t2 + t3;
+@@ -1293,7 +1293,7 @@
+ t2 -= t3;
+ t1 -= t3;
+
+- t3 = cos18[2] * (in[2] + in[14]);
++ t3 = REAL_MUL(cos18[2], (in[2] + in[14]));
+
+ t1 += t3;
+ tmp[3] += t1;
+@@ -1308,35 +1308,35 @@
+ {
+ real t0, t1, t2, t3, t4, t5, t6, t7;
+
+- t1 = COS6_2 * in[12];
+- t2 = COS6_2 * (in[8] + in[16] - in[4]);
++ t1 = REAL_MUL(COS6_2, in[12]);
++ t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4]));
+
+ t3 = in[0] + t1;
+ t4 = in[0] - t1 - t1;
+ t5 = t4 - t2;
+ tmp[4] = t4 + t2 + t2;
+
+- t0 = cos9[0] * (in[4] + in[8]);
+- t1 = cos9[1] * (in[8] - in[16]);
++ t0 = REAL_MUL(cos9[0], (in[4] + in[8]));
++ t1 = REAL_MUL(cos9[1], (in[8] - in[16]));
+
+- t2 = cos9[2] * (in[4] + in[16]);
++ t2 = REAL_MUL(cos9[2], (in[4] + in[16]));
+
+ t6 = t3 - t0 - t2;
+ t0 += t3 + t1;
+ t3 += t2 - t1;
+
+- t2 = cos18[0] * (in[2] + in[10]);
+- t4 = cos18[1] * (in[10] - in[14]);
+- t7 = COS6_1 * in[6];
++ t2 = REAL_MUL(cos18[0], (in[2] + in[10]));
++ t4 = REAL_MUL(cos18[1], (in[10] - in[14]));
++ t7 = REAL_MUL(COS6_1, in[6]);
+
+ t1 = t2 + t4 + t7;
+ tmp[0] = t0 + t1;
+ tmp[8] = t0 - t1;
+- t1 = cos18[2] * (in[2] + in[14]);
++ t1 = REAL_MUL(cos18[2], (in[2] + in[14]));
+ t2 += t1 - t7;
+
+ tmp[3] = t3 + t2;
+- t0 = COS6_1 * (in[10] + in[14] - in[2]);
++ t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2]));
+ tmp[5] = t3 - t2;
+
+ t4 -= t1 + t7;
+@@ -1351,53 +1351,53 @@
+ {
+ real t0, t1, t2, t3, t4, t5, t6, t7;
+
+- t1 = COS6_2 * in[13];
+- t2 = COS6_2 * (in[9] + in[17] - in[5]);
++ t1 = REAL_MUL(COS6_2, in[13]);
++ t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5]));
+
+ t3 = in[1] + t1;
+ t4 = in[1] - t1 - t1;
+ t5 = t4 - t2;
+
+- t0 = cos9[0] * (in[5] + in[9]);
+- t1 = cos9[1] * (in[9] - in[17]);
++ t0 = REAL_MUL(cos9[0], (in[5] + in[9]));
++ t1 = REAL_MUL(cos9[1], (in[9] - in[17]));
+
+- tmp[13] = (t4 + t2 + t2) * tfcos36[17-13];
+- t2 = cos9[2] * (in[5] + in[17]);
++ tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]);
++ t2 = REAL_MUL(cos9[2], (in[5] + in[17]));
+
+ t6 = t3 - t0 - t2;
+ t0 += t3 + t1;
+ t3 += t2 - t1;
+
+- t2 = cos18[0] * (in[3] + in[11]);
+- t4 = cos18[1] * (in[11] - in[15]);
+- t7 = COS6_1 * in[7];
++ t2 = REAL_MUL(cos18[0], (in[3] + in[11]));
++ t4 = REAL_MUL(cos18[1], (in[11] - in[15]));
++ t7 = REAL_MUL(COS6_1, in[7]);
+
+ t1 = t2 + t4 + t7;
+- tmp[17] = (t0 + t1) * tfcos36[17-17];
+- tmp[9] = (t0 - t1) * tfcos36[17-9];
+- t1 = cos18[2] * (in[3] + in[15]);
++ tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]);
++ tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]);
++ t1 = REAL_MUL(cos18[2], (in[3] + in[15]));
+ t2 += t1 - t7;
+
+- tmp[14] = (t3 + t2) * tfcos36[17-14];
+- t0 = COS6_1 * (in[11] + in[15] - in[3]);
+- tmp[12] = (t3 - t2) * tfcos36[17-12];
++ tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]);
++ t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3]));
++ tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]);
+
+ t4 -= t1 + t7;
+
+- tmp[16] = (t5 - t0) * tfcos36[17-16];
+- tmp[10] = (t5 + t0) * tfcos36[17-10];
+- tmp[15] = (t6 + t4) * tfcos36[17-15];
+- tmp[11] = (t6 - t4) * tfcos36[17-11];
++ tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]);
++ tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]);
++ tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]);
++ tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]);
+ }
+
+ #define MACRO(v) { \
+ real tmpval; \
+ tmpval = tmp[(v)] + tmp[17-(v)]; \
+- out2[9+(v)] = tmpval * w[27+(v)]; \
+- out2[8-(v)] = tmpval * w[26-(v)]; \
++ out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \
++ out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \
+ tmpval = tmp[(v)] - tmp[17-(v)]; \
+- ts[SBLIMIT*(8-(v))] = out1[8-(v)] + tmpval * w[8-(v)]; \
+- ts[SBLIMIT*(9+(v))] = out1[9+(v)] + tmpval * w[9+(v)]; }
++ ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \
++ ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); }
+
+ {
+ register real *out2 = o2;
+@@ -1422,20 +1422,20 @@
+
+ #define MACRO0(v) { \
+ real tmp; \
+- out2[9+(v)] = (tmp = sum0 + sum1) * w[27+(v)]; \
+- out2[8-(v)] = tmp * w[26-(v)]; } \
++ out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \
++ out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \
+ sum0 -= sum1; \
+- ts[SBLIMIT*(8-(v))] = out1[8-(v)] + sum0 * w[8-(v)]; \
+- ts[SBLIMIT*(9+(v))] = out1[9+(v)] + sum0 * w[9+(v)];
++ ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \
++ ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]);
+ #define MACRO1(v) { \
+ real sum0,sum1; \
+ sum0 = tmp1a + tmp2a; \
+- sum1 = (tmp1b + tmp2b) * tfcos36[(v)]; \
++ sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \
+ MACRO0(v); }
+ #define MACRO2(v) { \
+ real sum0,sum1; \
+ sum0 = tmp2a - tmp1a; \
+- sum1 = (tmp2b - tmp1b) * tfcos36[(v)]; \
++ sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \
+ MACRO0(v); }
+
+ register const real *c = COS9;
+@@ -1446,17 +1446,17 @@
+
+ real ta33,ta66,tb33,tb66;
+
+- ta33 = in[2*3+0] * c[3];
+- ta66 = in[2*6+0] * c[6] + in[2*0+0];
+- tb33 = in[2*3+1] * c[3];
+- tb66 = in[2*6+1] * c[6] + in[2*0+1];
++ ta33 = REAL_MUL(in[2*3+0], c[3]);
++ ta66 = REAL_MUL(in[2*6+0], c[6]);
++ tb33 = REAL_MUL(in[2*3+1], c[3]);
++ tb66 = REAL_MUL(in[2*6+1], c[6]);
+
+ {
+ real tmp1a,tmp2a,tmp1b,tmp2b;
+- tmp1a = in[2*1+0] * c[1] + ta33 + in[2*5+0] * c[5] + in[2*7+0] * c[7];
+- tmp1b = in[2*1+1] * c[1] + tb33 + in[2*5+1] * c[5] + in[2*7+1] * c[7];
+- tmp2a = in[2*2+0] * c[2] + in[2*4+0] * c[4] + ta66 + in[2*8+0] * c[8];
+- tmp2b = in[2*2+1] * c[2] + in[2*4+1] * c[4] + tb66 + in[2*8+1] * c[8];
++ tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]);
++ tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]);
++ tmp2a = REAL_MUL(in[2*2+0], c[2]) + REAL_MUL(in[2*4+0], c[4]) + ta66 + REAL_MUL(in[2*8+0], c[8]);
++ tmp2b = REAL_MUL(in[2*2+1], c[2]) + REAL_MUL(in[2*4+1], c[4]) + tb66 + REAL_MUL(in[2*8+1], c[8]);
+
+ MACRO1(0);
+ MACRO2(8);
+@@ -1464,10 +1464,10 @@
+
+ {
+ real tmp1a,tmp2a,tmp1b,tmp2b;
+- tmp1a = ( in[2*1+0] - in[2*5+0] - in[2*7+0] ) * c[3];
+- tmp1b = ( in[2*1+1] - in[2*5+1] - in[2*7+1] ) * c[3];
+- tmp2a = ( in[2*2+0] - in[2*4+0] - in[2*8+0] ) * c[6] - in[2*6+0] + in[2*0+0];
+- tmp2b = ( in[2*2+1] - in[2*4+1] - in[2*8+1] ) * c[6] - in[2*6+1] + in[2*0+1];
++ tmp1a = REAL_MUL(( in[2*1+0] - in[2*5+0] - in[2*7+0] ), c[3]);
++ tmp1b = REAL_MUL(( in[2*1+1] - in[2*5+1] - in[2*7+1] ), c[3]);
++ tmp2a = REAL_MUL(( in[2*2+0] - in[2*4+0] - in[2*8+0] ), c[6]) - in[2*6+0] + in[2*0+0];
++ tmp2b = REAL_MUL(( in[2*2+1] - in[2*4+1] - in[2*8+1] ), c[6]) - in[2*6+1] + in[2*0+1];
+
+ MACRO1(1);
+ MACRO2(7);
+@@ -1475,10 +1475,10 @@
+
+ {
+ real tmp1a,tmp2a,tmp1b,tmp2b;
+- tmp1a = in[2*1+0] * c[5] - ta33 - in[2*5+0] * c[7] + in[2*7+0] * c[1];
+- tmp1b = in[2*1+1] * c[5] - tb33 - in[2*5+1] * c[7] + in[2*7+1] * c[1];
+- tmp2a = - in[2*2+0] * c[8] - in[2*4+0] * c[2] + ta66 + in[2*8+0] * c[4];
+- tmp2b = - in[2*2+1] * c[8] - in[2*4+1] * c[2] + tb66 + in[2*8+1] * c[4];
++ tmp1a = REAL_MUL(in[2*1+0], c[5]) - ta33 - REAL_MUL(in[2*5+0], c[7]) + REAL_MUL(in[2*7+0], c[1]);
++ tmp1b = REAL_MUL(in[2*1+1], c[5]) - tb33 - REAL_MUL(in[2*5+1], c[7]) + REAL_MUL(in[2*7+1], c[1]);
++ tmp2a = - REAL_MUL(in[2*2+0], c[8]) - REAL_MUL(in[2*4+0], c[2]) + ta66 + REAL_MUL(in[2*8+0], c[4]);
++ tmp2b = - REAL_MUL(in[2*2+1], c[8]) - REAL_MUL(in[2*4+1], c[2]) + tb66 + REAL_MUL(in[2*8+1], c[4]);
+
+ MACRO1(2);
+ MACRO2(6);
+@@ -1486,10 +1486,10 @@
+
+ {
+ real tmp1a,tmp2a,tmp1b,tmp2b;
+- tmp1a = in[2*1+0] * c[7] - ta33 + in[2*5+0] * c[1] - in[2*7+0] * c[5];
+- tmp1b = in[2*1+1] * c[7] - tb33 + in[2*5+1] * c[1] - in[2*7+1] * c[5];
+- tmp2a = - in[2*2+0] * c[4] + in[2*4+0] * c[8] + ta66 - in[2*8+0] * c[2];
+- tmp2b = - in[2*2+1] * c[4] + in[2*4+1] * c[8] + tb66 - in[2*8+1] * c[2];
++ tmp1a = REAL_MUL(in[2*1+0], c[7]) - ta33 + REAL_MUL(in[2*5+0], c[1]) - REAL_MUL(in[2*7+0], c[5]);
++ tmp1b = REAL_MUL(in[2*1+1], c[7]) - tb33 + REAL_MUL(in[2*5+1], c[1]) - REAL_MUL(in[2*7+1], c[5]);
++ tmp2a = - REAL_MUL(in[2*2+0], c[4]) + REAL_MUL(in[2*4+0], c[8]) + ta66 - REAL_MUL(in[2*8+0], c[2]);
++ tmp2b = - REAL_MUL(in[2*2+1], c[4]) + REAL_MUL(in[2*4+1], c[8]) + tb66 - REAL_MUL(in[2*8+1], c[2]);
+
+ MACRO1(3);
+ MACRO2(5);
+@@ -1498,7 +1498,7 @@
+ {
+ real sum0,sum1;
+ sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0];
+- sum1 = (in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ) * tfcos36[4];
++ sum1 = REAL_MUL((in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ), tfcos36[4]);
+ MACRO0(4);
+ }
+ }
+@@ -1522,19 +1522,19 @@
+ \
+ in5 += in3; in3 += in1; \
+ \
+- in2 *= COS6_1; \
+- in3 *= COS6_1; \
++ in2 = REAL_MUL(in2, COS6_1); \
++ in3 = REAL_MUL(in3, COS6_1); \
+
+ #define DCT12_PART2 \
+- in0 += in4 * COS6_2; \
++ in0 += REAL_MUL(in4, COS6_2); \
+ \
+ in4 = in0 + in2; \
+ in0 -= in2; \
+ \
+- in1 += in5 * COS6_2; \
++ in1 += REAL_MUL(in5, COS6_2); \
+ \
+- in5 = (in1 + in3) * tfcos12[0]; \
+- in1 = (in1 - in3) * tfcos12[2]; \
++ in5 = REAL_MUL((in1 + in3), tfcos12[0]); \
++ in1 = REAL_MUL((in1 - in3), tfcos12[2]); \
+ \
+ in3 = in4 + in5; \
+ in4 -= in5; \
+@@ -1554,27 +1554,27 @@
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+- real tmp2 = (in1 - in5) * tfcos12[1];
++ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+- ts[(17-1)*SBLIMIT] = out1[17-1] + tmp0 * wi[11-1];
+- ts[(12+1)*SBLIMIT] = out1[12+1] + tmp0 * wi[6+1];
+- ts[(6 +1)*SBLIMIT] = out1[6 +1] + tmp1 * wi[1];
+- ts[(11-1)*SBLIMIT] = out1[11-1] + tmp1 * wi[5-1];
++ ts[(17-1)*SBLIMIT] = out1[17-1] + REAL_MUL(tmp0, wi[11-1]);
++ ts[(12+1)*SBLIMIT] = out1[12+1] + REAL_MUL(tmp0, wi[6+1]);
++ ts[(6 +1)*SBLIMIT] = out1[6 +1] + REAL_MUL(tmp1, wi[1]);
++ ts[(11-1)*SBLIMIT] = out1[11-1] + REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+- ts[(17-0)*SBLIMIT] = out1[17-0] + in2 * wi[11-0];
+- ts[(12+0)*SBLIMIT] = out1[12+0] + in2 * wi[6+0];
+- ts[(12+2)*SBLIMIT] = out1[12+2] + in3 * wi[6+2];
+- ts[(17-2)*SBLIMIT] = out1[17-2] + in3 * wi[11-2];
+-
+- ts[(6+0)*SBLIMIT] = out1[6+0] + in0 * wi[0];
+- ts[(11-0)*SBLIMIT] = out1[11-0] + in0 * wi[5-0];
+- ts[(6+2)*SBLIMIT] = out1[6+2] + in4 * wi[2];
+- ts[(11-2)*SBLIMIT] = out1[11-2] + in4 * wi[5-2];
++ ts[(17-0)*SBLIMIT] = out1[17-0] + REAL_MUL(in2, wi[11-0]);
++ ts[(12+0)*SBLIMIT] = out1[12+0] + REAL_MUL(in2, wi[6+0]);
++ ts[(12+2)*SBLIMIT] = out1[12+2] + REAL_MUL(in3, wi[6+2]);
++ ts[(17-2)*SBLIMIT] = out1[17-2] + REAL_MUL(in3, wi[11-2]);
++
++ ts[(6 +0)*SBLIMIT] = out1[6+0] + REAL_MUL(in0, wi[0]);
++ ts[(11-0)*SBLIMIT] = out1[11-0] + REAL_MUL(in0, wi[5-0]);
++ ts[(6 +2)*SBLIMIT] = out1[6+2] + REAL_MUL(in4, wi[2]);
++ ts[(11-2)*SBLIMIT] = out1[11-2] + REAL_MUL(in4, wi[5-2]);
+ }
+
+ in++;
+@@ -1588,27 +1588,27 @@
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+- real tmp2 = (in1 - in5) * tfcos12[1];
++ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+- out2[5-1] = tmp0 * wi[11-1];
+- out2[0+1] = tmp0 * wi[6+1];
+- ts[(12+1)*SBLIMIT] += tmp1 * wi[1];
+- ts[(17-1)*SBLIMIT] += tmp1 * wi[5-1];
++ out2[5-1] = REAL_MUL(tmp0, wi[11-1]);
++ out2[0+1] = REAL_MUL(tmp0, wi[6+1]);
++ ts[(12+1)*SBLIMIT] += REAL_MUL(tmp1, wi[1]);
++ ts[(17-1)*SBLIMIT] += REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+- out2[5-0] = in2 * wi[11-0];
+- out2[0+0] = in2 * wi[6+0];
+- out2[0+2] = in3 * wi[6+2];
+- out2[5-2] = in3 * wi[11-2];
+-
+- ts[(12+0)*SBLIMIT] += in0 * wi[0];
+- ts[(17-0)*SBLIMIT] += in0 * wi[5-0];
+- ts[(12+2)*SBLIMIT] += in4 * wi[2];
+- ts[(17-2)*SBLIMIT] += in4 * wi[5-2];
++ out2[5-0] = REAL_MUL(in2, wi[11-0]);
++ out2[0+0] = REAL_MUL(in2, wi[6+0]);
++ out2[0+2] = REAL_MUL(in3, wi[6+2]);
++ out2[5-2] = REAL_MUL(in3, wi[11-2]);
++
++ ts[(12+0)*SBLIMIT] += REAL_MUL(in0, wi[0]);
++ ts[(17-0)*SBLIMIT] += REAL_MUL(in0, wi[5-0]);
++ ts[(12+2)*SBLIMIT] += REAL_MUL(in4, wi[2]);
++ ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]);
+ }
+
+ in++;
+@@ -1623,27 +1623,27 @@
+ {
+ real tmp0,tmp1 = (in0 - in4);
+ {
+- real tmp2 = (in1 - in5) * tfcos12[1];
++ real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]);
+ tmp0 = tmp1 + tmp2;
+ tmp1 -= tmp2;
+ }
+- out2[11-1] = tmp0 * wi[11-1];
+- out2[6 +1] = tmp0 * wi[6+1];
+- out2[0+1] += tmp1 * wi[1];
+- out2[5-1] += tmp1 * wi[5-1];
++ out2[11-1] = REAL_MUL(tmp0, wi[11-1]);
++ out2[6 +1] = REAL_MUL(tmp0, wi[6+1]);
++ out2[0+1] += REAL_MUL(tmp1, wi[1]);
++ out2[5-1] += REAL_MUL(tmp1, wi[5-1]);
+ }
+
+ DCT12_PART2
+
+- out2[11-0] = in2 * wi[11-0];
+- out2[6 +0] = in2 * wi[6+0];
+- out2[6 +2] = in3 * wi[6+2];
+- out2[11-2] = in3 * wi[11-2];
+-
+- out2[0+0] += in0 * wi[0];
+- out2[5-0] += in0 * wi[5-0];
+- out2[0+2] += in4 * wi[2];
+- out2[5-2] += in4 * wi[5-2];
++ out2[11-0] = REAL_MUL(in2, wi[11-0]);
++ out2[6 +0] = REAL_MUL(in2, wi[6+0]);
++ out2[6 +2] = REAL_MUL(in3, wi[6+2]);
++ out2[11-2] = REAL_MUL(in3, wi[11-2]);
++
++ out2[0+0] += REAL_MUL(in0, wi[0]);
++ out2[5-0] += REAL_MUL(in0, wi[5-0]);
++ out2[0+2] += REAL_MUL(in4, wi[2]);
++ out2[5-2] += REAL_MUL(in4, wi[5-2]);
+ }
+ }
+
+@@ -1693,7 +1693,7 @@
+ int i;
+ for(i=0;i<SSLIMIT;i++) {
+ tspnt[i*SBLIMIT] = *rawout1++;
+- *rawout2++ = 0.0;
++ *rawout2++ = DOUBLE_TO_REAL(0.0);
+ }
+ }
+ }
+@@ -1865,5 +1865,3 @@
+
+ return clip;
+ }
+-
+-
diff --git a/audio/mpg123-nas/patches/patch-aj b/audio/mpg123-nas/patches/patch-aj
new file mode 100644
index 00000000000..f0780d1e8eb
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-aj
@@ -0,0 +1,42 @@
+$NetBSD: patch-aj,v 1.1.1.1 2002/05/25 06:28:01 rh Exp $
+
+--- mpg123.h.orig Sat May 29 00:51:58 1999
++++ mpg123.h Tue Oct 12 01:17:16 1999
+@@ -56,8 +56,37 @@
+ # define real float
+ #elif defined(REAL_IS_LONG_DOUBLE)
+ # define real long double
++#elif defined(REAL_IS_FIXED)
++# define real long
++
++# define REAL_RADIX 15
++# define REAL_FACTOR (32.0 * 1024.0)
++
++# define REAL_PLUS_32767 ( 32767 << REAL_RADIX )
++# define REAL_MINUS_32768 ( -32768 << REAL_RADIX )
++
++# define DOUBLE_TO_REAL(x) ((int)((x) * REAL_FACTOR))
++# define REAL_TO_SHORT(x) ((x) >> REAL_RADIX)
++# define REAL_MUL(x, y) (((long long)(x) * (long long)(y)) >> REAL_RADIX)
++
+ #else
+ # define real double
++#endif
++
++#ifndef DOUBLE_TO_REAL
++# define DOUBLE_TO_REAL(x) (x)
++#endif
++#ifndef REAL_TO_SHORT
++# define REAL_TO_SHORT(x) (x)
++#endif
++#ifndef REAL_PLUS_32767
++# define REAL_PLUS_32767 32767.0
++#endif
++#ifndef REAL_MINUS_32768
++# define REAL_MINUS_32768 -32768.0
++#endif
++#ifndef REAL_MUL
++# define REAL_MUL(x, y) ((x) * (y))
+ #endif
+
+ #ifdef __GNUC__
diff --git a/audio/mpg123-nas/patches/patch-ak b/audio/mpg123-nas/patches/patch-ak
new file mode 100644
index 00000000000..02dee9e1026
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-ak
@@ -0,0 +1,40 @@
+$NetBSD: patch-ak,v 1.1.1.1 2002/05/25 06:28:01 rh Exp $
+
+--- tabinit.c.orig Mon Feb 15 23:55:11 1999
++++ tabinit.c Thu Aug 12 17:31:33 1999
+@@ -56,7 +56,7 @@
+ kr=0x10>>i; divv=0x40>>i;
+ costab = pnts[i];
+ for(k=0;k<kr;k++)
+- costab[k] = 1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv));
++ costab[k] = DOUBLE_TO_REAL(1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)));
+ #ifdef USE_3DNOW
+ for(k=0;k<kr;k++)
+ costab[k+kr] = -costab[k];
+@@ -69,7 +69,7 @@
+ for(i=0,j=0;i<256;i++,j++,idx+=32)
+ {
+ if(idx < 512+16)
+- decwin[idx+16] = decwin[idx] = (double) intwinbase[j] / 65536.0 * (double) scaleval;
++ decwin[idx+16] = decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] / 65536.0 * (double) scaleval);
+
+ if(i % 32 == 31)
+ idx -= 1023;
+@@ -80,7 +80,7 @@
+ for( /* i=256 */ ;i<512;i++,j--,idx+=32)
+ {
+ if(idx < 512+16)
+- decwin[idx+16] = decwin[idx] = (double) intwinbase[j] / 65536.0 * (double) scaleval;
++ decwin[idx+16] = decwin[idx] = DOUBLE_TO_REAL((double) intwinbase[j] / 65536.0 * (double) scaleval);
+
+ if(i % 32 == 31)
+ idx -= 1023;
+@@ -91,7 +91,7 @@
+ #ifdef USE_3DNOW
+ if(!param.down_sample) {
+ for(i=0;i<512+32;i++) {
+- decwin[512+31-i] *= 65536.0; /* allows faster clipping in 3dnow code */
++ decwin[512+31-i] = REAL_MUL(decwin[512+31-i], 65536.0); /* allows faster clipping in 3dnow code */
+ decwin[512+32+i] = decwin[512+31-i];
+ }
+ }
diff --git a/audio/mpg123-nas/patches/patch-al b/audio/mpg123-nas/patches/patch-al
new file mode 100644
index 00000000000..6fc1cbb1141
--- /dev/null
+++ b/audio/mpg123-nas/patches/patch-al
@@ -0,0 +1,40 @@
+$NetBSD: patch-al,v 1.1.1.1 2002/05/25 06:28:01 rh Exp $
+
+--- readers.c.orig Thu Mar 4 11:03:49 1999
++++ readers.c Sat May 12 20:09:05 2001
+@@ -1,5 +1,9 @@
+ #include <stdlib.h>
+
++#ifdef __NetBSD__
++#include <sys/param.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+@@ -251,7 +255,12 @@
+ return -1;
+
+ mapend = mapbuf + len;
+-
++
++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
++ if(madvise(mapbuf, mapend-mapbuf, MADV_SEQUENTIAL) < 0)
++ fprintf(stderr,"madvise failed, continuing anyways..\n");
++#endif
++
+ if(param.verbose > 1)
+ fprintf(stderr,"Using memory mapped IO for this stream.\n");
+
+@@ -268,6 +276,11 @@
+
+ static void mapped_close(struct reader *rds)
+ {
++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104030000)
++ if(madvise(mapbuf, mapend-mapbuf, MADV_FREE) < 0)
++ fprintf(stderr,"madvise failed, continuing anyways..\n");
++#endif
++
+ munmap((void *)mapbuf,mapend-mapbuf);
+ if (rds->flags & READER_FD_OPENED)
+ close(rds->filept);