diff options
author | wiz <wiz> | 2011-11-22 20:57:34 +0000 |
---|---|---|
committer | wiz <wiz> | 2011-11-22 20:57:34 +0000 |
commit | 1b282c21ad21372e8e37e2f17dfb739a2b3e78d9 (patch) | |
tree | 45152f6ee2dfdc27c643f70c36c92fac5b2fef5e | |
parent | 100c63a925388dcb2dbca7069c93592e04c23975 (diff) | |
download | pkgsrc-1b282c21ad21372e8e37e2f17dfb739a2b3e78d9.tar.gz |
Unconditionalize the DragonFly patches for newer c++.
Use patches instead of sed.
Set LICENSE while here.
-rw-r--r-- | audio/maplay/Makefile | 21 | ||||
-rw-r--r-- | audio/maplay/distinfo | 18 | ||||
-rw-r--r-- | audio/maplay/patches/patch-aa | 16 | ||||
-rw-r--r-- | audio/maplay/patches/patch-ad | 88 | ||||
-rw-r--r-- | audio/maplay/patches/patch-af | 69 | ||||
-rw-r--r-- | audio/maplay/patches/patch-ah | 178 | ||||
-rw-r--r-- | audio/maplay/patches/patch-ai | 273 | ||||
-rw-r--r-- | audio/maplay/patches/patch-aj | 19 | ||||
-rw-r--r-- | audio/maplay/patches/patch-al | 81 | ||||
-rw-r--r-- | audio/maplay/patches/patch-crc.cc | 13 | ||||
-rw-r--r-- | audio/maplay/patches/patch-synthesis__filter.h | 13 |
11 files changed, 709 insertions, 80 deletions
diff --git a/audio/maplay/Makefile b/audio/maplay/Makefile index 8a9abd0227c..e27bf73fd94 100644 --- a/audio/maplay/Makefile +++ b/audio/maplay/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.22 2011/11/22 16:37:01 marino Exp $ +# $NetBSD: Makefile,v 1.23 2011/11/22 20:57:34 wiz Exp $ DISTNAME= maplay1_2 PKGNAME= maplay-1.2 @@ -9,6 +9,7 @@ EXTRACT_SUFX= .tar MAINTAINER= pkgsrc-users@NetBSD.org COMMENT= MPEG audio player/decoder for layer I and II MPEG audio streams +LICENSE= gnu-gpl-v2 PKG_DESTDIR_SUPPORT= user-destdir @@ -19,24 +20,6 @@ NOT_FOR_PLATFORM= Interix-*-* INSTALLATION_DIRS= bin -.include "../../mk/bsd.prefs.mk" -.if ${OPSYS} == "DragonFly" -SUBST_CLASSES+= iostream iomanip -SUBST_STAGE.iostream= post-patch -SUBST_STAGE.iomanip= post-patch -SUBST_FILES.iostream= obuffer.h synthesis_filter.h \ - ulaw.cc crc.cc ibitstream.cc obuffer.cc \ - subband_layer_1.cc subband_layer_2.cc \ - scalefactors.cc synthesis_filter.cc \ - header.cc maplay.cc -SUBST_FILES.iomanip= header.cc maplay.cc -SUBST_SED.iostream= -e 's,<iostream.h>,<iostream>,' \ - -e 's,cerr,std::cerr,g' -SUBST_SED.iomanip= -e 's,<iomanip.h>,<iomanip>,' -SUBST_MESSAGE.iostream= Fixing old iostream headers includes -SUBST_MESSAGE.iomanip= Fixing old iomanip headers includes -.endif - pre-configure: cd ${WRKSRC} && ${MAKE} pre-install diff --git a/audio/maplay/distinfo b/audio/maplay/distinfo index b85660260da..87e63c69e88 100644 --- a/audio/maplay/distinfo +++ b/audio/maplay/distinfo @@ -1,20 +1,22 @@ -$NetBSD: distinfo,v 1.9 2011/11/22 16:37:01 marino Exp $ +$NetBSD: distinfo,v 1.10 2011/11/22 20:57:34 wiz Exp $ SHA1 (maplay1_2.tar) = faeac51cfbf011956a17721e2077d0ed11f8d8dd RMD160 (maplay1_2.tar) = bc016d4cc8f356d9c2c0a90d4afde5e67c45ba14 Size (maplay1_2.tar) = 286720 bytes -SHA1 (patch-aa) = 46d7f3934c08ac98e4ac7646105fce635d4a5313 +SHA1 (patch-aa) = e8295926e46f814752543fda24cd292b2f4c1ec2 SHA1 (patch-ab) = 92582f6a9b87ca4c61aaf42a1d03349b455997dc SHA1 (patch-ac) = c926ed6b98b9df1d569ee35fba66c170a4999785 -SHA1 (patch-ad) = 389c418dac740b6959b441439cc4660ed28daee0 +SHA1 (patch-ad) = 24f847f2c19027546c4bcf15c2dd96bfc69b670c SHA1 (patch-ae) = 4579d1dc9dbae73c0d33f0fc5fe038733640bcef -SHA1 (patch-af) = 843b8fad21e2feeee07feb3292a34456f88c639f +SHA1 (patch-af) = 29c0156d162a5370720cc2d5afd58ce4dc6dabd3 SHA1 (patch-ag) = 582bec6631acd1478dacc19feba60e4bed9062ab -SHA1 (patch-ah) = 72f4adc3c698c48c91a42f3c32f7cf0ef3557c82 -SHA1 (patch-ai) = 2d7cc43f33db4f60549e2be27f388b92c7b0b4a8 -SHA1 (patch-aj) = 9b44b0e3b85adfe24419d8fa4dac9253fbf9c36d +SHA1 (patch-ah) = b71bb9c790b8e0bb3dfd0737ac42657672d511d4 +SHA1 (patch-ai) = 5a7d59710ecc97da72f4da9aa86db0794ae0dbaa +SHA1 (patch-aj) = e81148e82e27e3b838a1e315823d84142dd95bc7 SHA1 (patch-ak) = 3edf1fb29f243eb5e0507f57fee2e200e9214045 -SHA1 (patch-al) = a59b2f93c01dd9ca83ebd655b63ce0b8327eaa3c +SHA1 (patch-al) = 71816fad0694ad1f2d93390eeabead28fbe429b5 SHA1 (patch-am) = f517221b15e69e20af1a3868e04870448490a841 SHA1 (patch-an) = 392078e383d68c290c049e9524904ee6b2010a93 SHA1 (patch-ao) = 742110dd6e021f86cca5f57634c78d19dd08fb9f +SHA1 (patch-crc.cc) = b3698f830af0ff8fc61e5fcd71982ba581cf8b74 +SHA1 (patch-synthesis__filter.h) = bceb1231ff2dddc9bbccdb42b3541e3fdbb0bcf0 diff --git a/audio/maplay/patches/patch-aa b/audio/maplay/patches/patch-aa index 56a01c07a59..531545577d2 100644 --- a/audio/maplay/patches/patch-aa +++ b/audio/maplay/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.4 2009/07/07 15:25:39 joerg Exp $ +$NetBSD: patch-aa,v 1.5 2011/11/22 20:57:35 wiz Exp $ ---- Makefile 2002/06/27 15:41:29 1.1 -+++ Makefile 2002/06/27 15:41:40 -@@ -39,7 +39,7 @@ +--- Makefile.orig 1994-06-23 12:14:46.000000000 +0000 ++++ Makefile +@@ -39,7 +39,7 @@ OBJS = maplay.o ibitstream.o header.o sc .SUFFIXES: .cc @@ -11,13 +11,13 @@ $NetBSD: patch-aa,v 1.4 2009/07/07 15:25:39 joerg Exp $ @./configuration.sh all: maplay -@@ -47,6 +47,9 @@ - maplay: $(OBJS) +@@ -48,6 +48,9 @@ maplay: $(OBJS) $(COMPILER) $(CFLAGS) $(OBJS) -o $@ $(LIBRARIES) -lm -strip $@ -+ + +install: all + ${INSTALL} -s -c -m 755 maplay ${DESTDIR}${PREFIX}/bin - ++ .cc.o: $(COMPILER) -c $(CFLAGS) $(INCLUDEDIRS) $*.cc -o $@ + diff --git a/audio/maplay/patches/patch-ad b/audio/maplay/patches/patch-ad index 347b3bd8269..37494bcba80 100644 --- a/audio/maplay/patches/patch-ad +++ b/audio/maplay/patches/patch-ad @@ -1,7 +1,27 @@ -$NetBSD: patch-ad,v 1.4 2002/06/27 15:52:14 agc Exp $ +$NetBSD: patch-ad,v 1.5 2011/11/22 20:57:35 wiz Exp $ ---- header.cc 2002/06/27 15:41:04 1.1 -+++ header.cc 2002/06/27 15:44:28 +--- header.cc.orig 1994-06-23 12:14:35.000000000 +0000 ++++ header.cc +@@ -20,15 +20,15 @@ + + /* + * Changes from version 1.1 to 1.2: +- * - iostreams manipulator calls like "cerr << setw (2) << ..." replaced by +- * "cerr.width (2); ..." due to problems with older GNU C++ releases. ++ * - iostreams manipulator calls like "std::cerr << setw (2) << ..." replaced by ++ * "std::cerr.width (2); ..." due to problems with older GNU C++ releases. + * - syncword recognition slightly changed + */ + + #include <sys/types.h> + #include <unistd.h> +-#include <iostream.h> +-#include <iomanip.h> ++#include <iostream> ++#include <iomanip> + #include <stdlib.h> + #include "header.h" + @@ -36,7 +36,7 @@ const uint32 Header::frequencies[3] = { 44100, 48000, 32000 }; @@ -11,18 +31,68 @@ $NetBSD: patch-ad,v 1.4 2002/06/27 15:52:14 agc Exp $ { uint32 headerstring; -@@ -48,8 +48,8 @@ - cerr << "invalid syncword 0x"; - cerr.width (8); - cerr.fill ('0'); +@@ -45,41 +45,41 @@ bool Header::read_header (Ibitstream *st + + if ((headerstring & 0xFFF80000) != 0xFFF80000) + { +- cerr << "invalid syncword 0x"; +- cerr.width (8); +- cerr.fill ('0'); - cerr << hex << headerstring - << " found at fileoffset " << dec -+ cerr << headerstring ++ std::cerr << "invalid syncword 0x"; ++ std::cerr.width (8); ++ std::cerr.fill ('0'); ++ std::cerr << headerstring + << " found at fileoffset " << lseek (stream->filedescriptor (), 0, SEEK_CUR) - 4 << '\n'; return False; } -@@ -161,7 +161,7 @@ + + if ((h_layer = (headerstring >> 17) & 3) == 0) + { +- cerr << "unknown layer identifier found!\n"; ++ std::cerr << "unknown layer identifier found!\n"; + exit (1); + } + h_layer = 4 - h_layer; // now 1 means Layer I and 3 means Layer III + if (h_layer == 3) + { +- cerr << "Sorry, Layer III not implemented!\n"; ++ std::cerr << "Sorry, Layer III not implemented!\n"; + exit (1); + } + h_protection_bit = (headerstring >> 16) & 1; + if ((h_bitrate_index = (headerstring >> 12) & 0xF) == 15) + { +- cerr << "unknown bitrate index found!\n"; ++ std::cerr << "unknown bitrate index found!\n"; + exit (1); + } + if (!h_bitrate_index) + { +- cerr << "free format not yet implemented!\n"; ++ std::cerr << "free format not yet implemented!\n"; + exit (1); + } + + if ((h_sample_frequency = (e_sample_frequency)((headerstring >> 10) & 3)) == 3) + { +- cerr << "unknown sample frequency!\n"; ++ std::cerr << "unknown sample frequency!\n"; + exit (1); + } + h_padding_bit = (headerstring >> 9) & 1; +@@ -90,7 +90,7 @@ bool Header::read_header (Ibitstream *st + h_mode != single_channel) || + (h_bitrate_index >= 11 && h_mode == single_channel)) + { +- cerr << "illegal combination of mode and bitrate in a layer II stream:\n" ++ std::cerr << "illegal combination of mode and bitrate in a layer II stream:\n" + " mode: " << mode_string () + << "\n bitrate: " << bitrate_string () << '\n'; + exit (1); +@@ -161,7 +161,7 @@ uint32 Header::calculate_framesize () static const int32 bitrates_layer_2[15] = { 0 /*free format*/, 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000 }; diff --git a/audio/maplay/patches/patch-af b/audio/maplay/patches/patch-af index 214365f126b..36747c77a2c 100644 --- a/audio/maplay/patches/patch-af +++ b/audio/maplay/patches/patch-af @@ -1,8 +1,13 @@ -$NetBSD: patch-af,v 1.1 2002/06/27 15:52:16 agc Exp $ +$NetBSD: patch-af,v 1.2 2011/11/22 20:57:35 wiz Exp $ ---- ibitstream.cc 2002/06/27 15:41:04 1.1 -+++ ibitstream.cc 2002/06/27 15:41:40 -@@ -33,6 +33,12 @@ +--- ibitstream.cc.orig 1994-06-23 12:14:35.000000000 +0000 ++++ ibitstream.cc +@@ -29,10 +29,16 @@ + #include <unistd.h> + #include <errno.h> + #include <fcntl.h> +-#include <iostream.h> ++#include <iostream> #include "all.h" #include "ibitstream.h" @@ -15,7 +20,16 @@ $NetBSD: patch-af,v 1.1 2002/06/27 15:52:16 agc Exp $ #define swap_int32(int_32) (((int_32) << 24) | (((int_32) << 8) & 0x00ff0000) | \ (((int_32) >> 8) & 0x0000ff00) | ((int_32) >> 24)) -@@ -64,7 +70,7 @@ +@@ -50,7 +56,7 @@ Ibitstream::Ibitstream (const char *file + { + if ((fd = open (filename, O_RDONLY, 0)) < 0) + { +- cerr << "can't open file \"" << filename << "\" for reading!\n"; ++ std::cerr << "can't open file \"" << filename << "\" for reading!\n"; + exit (1); + } + wordpointer = buffer; +@@ -64,7 +70,7 @@ Ibitstream::~Ibitstream (void) // des } @@ -24,7 +38,7 @@ $NetBSD: patch-af,v 1.1 2002/06/27 15:52:16 agc Exp $ { int readvalue; -@@ -102,7 +108,7 @@ +@@ -102,13 +108,13 @@ bool Ibitstream::get_header (uint32 *hea } @@ -33,3 +47,46 @@ $NetBSD: patch-af,v 1.1 2002/06/27 15:52:16 agc Exp $ { int readvalue; + if (bytesize > (bufferintsize << 2)) + { +- cerr << "Internal error: framelength > bufferlength?!\n"; ++ std::cerr << "Internal error: framelength > bufferlength?!\n"; + exit (1); + } + +@@ -170,7 +176,7 @@ uint32 Ibitstream::get_bits (uint32 numb + #ifdef DEBUG + if (number_of_bits < 1 || number_of_bits > 16) + { +- cerr << "illegal parameter in Ibitstream::get_bits() !\n"; ++ std::cerr << "illegal parameter in Ibitstream::get_bits() !\n"; + exit (1); + } + #endif +@@ -184,7 +190,7 @@ uint32 Ibitstream::get_bits (uint32 numb + bitindex = 0; + if ((char *)++wordpointer > (char *)buffer + framesize) + { +- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; ++ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; + exit (1); + } + } +@@ -197,7 +203,7 @@ uint32 Ibitstream::get_bits (uint32 numb + *(int16 *)&returnvalue = *((int16 *)wordpointer + 1); + if ((char *)++wordpointer > (char *)buffer + framesize) + { +- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; ++ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; + exit (1); + } + *((int16 *)&returnvalue + 1) = *(int16 *)wordpointer; +@@ -205,7 +211,7 @@ uint32 Ibitstream::get_bits (uint32 numb + *((int16 *)&returnvalue + 1) = *(int16 *)wordpointer; + if ((char *)++wordpointer > (char *)buffer + framesize) + { +- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; ++ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n"; + exit (1); + } + *(int16 *)&returnvalue = *((int16 *)wordpointer + 1); diff --git a/audio/maplay/patches/patch-ah b/audio/maplay/patches/patch-ah index 8bb3d6cf4e7..3a0fbcd64bc 100644 --- a/audio/maplay/patches/patch-ah +++ b/audio/maplay/patches/patch-ah @@ -1,7 +1,28 @@ -$NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ +$NetBSD: patch-ah,v 1.5 2011/11/22 20:57:35 wiz Exp $ --- maplay.cc.orig 1994-06-23 12:14:36.000000000 +0000 +++ maplay.cc +@@ -31,16 +31,16 @@ + * on an amd device or in stdout mode, if compiled with ULAW defined + * - option -amd forces maplay to treat /dev/audio as an amd device + * in the u-law version. This is helpful on some SPARC clones. +- * - iostreams manipulator calls like "cerr << setw (2) << ..." replaced by +- * "cerr.width (2); ..." due to problems with older GNU C++ releases. ++ * - iostreams manipulator calls like "std::cerr << setw (2) << ..." replaced by ++ * "std::cerr.width (2); ..." due to problems with older GNU C++ releases. + */ + + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <math.h> +-#include <iostream.h> +-#include <iomanip.h> ++#include <iostream> ++#include <iomanip> + #include "all.h" + #include "crc.h" + #include "header.h" @@ -54,14 +54,14 @@ // data extracted from commandline arguments: @@ -22,7 +43,7 @@ $NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ static real scalefactor; // data extracted from header of first frame: -@@ -90,10 +90,10 @@ static void Exit (int returncode) +@@ -90,15 +90,15 @@ static void Exit (int returncode) } @@ -35,6 +56,12 @@ $NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ if (argc < 2 || !strncmp (argv[1], "-h", 2)) { + usage: +- cerr << "\nusage: " << argv[0] ++ std::cerr << "\nusage: " << argv[0] + << " [-v] [-s] [-l] [-r] " + #ifdef SPARC + "[-us] [-uh] " @@ -146,6 +146,12 @@ usage: #ifdef Solaris "SPARC Solaris 2.x" @@ -70,7 +97,24 @@ $NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ break; #ifdef SPARC case 'u': -@@ -250,7 +258,7 @@ usage: +@@ -216,7 +224,7 @@ usage: + case 'f': + if (++i == argc) + { +- cerr << "please specify a new scalefactor after the -f option!\n"; ++ std::cerr << "please specify a new scalefactor after the -f option!\n"; + exit (1); + } + use_own_scalefactor = True; +@@ -243,14 +251,14 @@ usage: + header = new Header; + if (!header->read_header (stream, &crc)) + { +- cerr << "no header found!\n"; ++ std::cerr << "no header found!\n"; + Exit (1); + } + // get info from header of first frame: layer = header->layer (); if ((mode = header->mode ()) == single_channel) @@ -97,7 +141,13 @@ $NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ //#ifdef your_machine // { // if (mode == single_channel || which_channels != both) -@@ -333,6 +352,7 @@ usage: +@@ -328,11 +347,12 @@ usage: + // } + //#else + { +- cerr << "Sorry, I don't know your audio device.\n" ++ std::cerr << "Sorry, I don't know your audio device.\n" + "Please use the stdout mode.\n"; Exit (0); } //#endif // !your_machine @@ -105,3 +155,123 @@ $NetBSD: patch-ah,v 1.4 2011/11/22 16:37:01 marino Exp $ #endif // !LINUX #endif // !SPARC #endif // !Indigo +@@ -345,22 +365,22 @@ usage: + ++name; + else + name = filename; +- cerr << name << " is a layer " << header->layer_string () << ' ' ++ std::cerr << name << " is a layer " << header->layer_string () << ' ' + << header->mode_string () << " MPEG audio stream with"; + if (!header->checksums ()) +- cerr << "out"; +- cerr << " checksums.\nThe sample frequency is " ++ std::cerr << "out"; ++ std::cerr << " checksums.\nThe sample frequency is " + << header->sample_frequency_string () << " at a bitrate of " + << header->bitrate_string () << ".\n" + "This stream is "; + if (header->original ()) +- cerr << "an original"; ++ std::cerr << "an original"; + else +- cerr << "a copy"; +- cerr << " and is "; ++ std::cerr << "a copy"; ++ std::cerr << " and is "; + if (!header->copyright ()) +- cerr << "not "; +- cerr << "copyright protected.\n"; ++ std::cerr << "not "; ++ std::cerr << "copyright protected.\n"; + } + + do +@@ -371,20 +391,20 @@ usage: + { + // layer switching is allowed + if (verbose_mode) +- cerr << "switching to layer " << header->layer_string () << ".\n"; ++ std::cerr << "switching to layer " << header->layer_string () << ".\n"; + layer = header->layer (); + } + if ((mode == single_channel && header->mode () != single_channel) || + (mode != single_channel && header->mode () == single_channel)) + { + // switching from single channel to stereo or vice versa is not allowed +- cerr << "illegal switch from single channel to stereo or vice versa!\n"; ++ std::cerr << "illegal switch from single channel to stereo or vice versa!\n"; + Exit (1); + } + if (header->sample_frequency () != sample_frequency) + { + // switching the sample frequency is not allowed +- cerr << "sorry, can't switch the sample frequency in the middle of the stream!\n"; ++ std::cerr << "sorry, can't switch the sample frequency in the middle of the stream!\n"; + Exit (1); + } + +@@ -423,7 +443,7 @@ usage: + } + else + { +- cerr << "sorry, layer 3 not implemented!\n"; ++ std::cerr << "sorry, layer 3 not implemented!\n"; + Exit (0); + } + +@@ -463,7 +483,7 @@ usage: + } + else + // Sh*t! Wrong crc checksum in frame! +- cerr << "WARNING: frame contains wrong crc checksum! (throwing frame away)\n"; ++ std::cerr << "WARNING: frame contains wrong crc checksum! (throwing frame away)\n"; + + for (i = 0; i < header->number_of_subbands (); ++i) + delete subbands[i]; +@@ -481,18 +501,18 @@ usage: + // check whether (one of) the filter(s) produced values not in [-1.0, 1.0]: + if (range_violations) + { +- cerr << range_violations << " range violations have occured!\n"; ++ std::cerr << range_violations << " range violations have occured!\n"; + if (stdout_mode) +- cerr << "If you notice these violations,\n"; ++ std::cerr << "If you notice these violations,\n"; + else +- cerr << "If you have noticed these violations,\n"; +- cerr << "please use the -f option with the value "; ++ std::cerr << "If you have noticed these violations,\n"; ++ std::cerr << "please use the -f option with the value "; + if (mode != single_channel && which_channels == both && + filter2->hardest_violation () > filter1->hardest_violation ()) +- cerr << filter2->recommended_scalefactor (); ++ std::cerr << filter2->recommended_scalefactor (); + else +- cerr << filter1->recommended_scalefactor (); +- cerr << "\nor a greater value up to 32768 and try again.\n"; ++ std::cerr << filter1->recommended_scalefactor (); ++ std::cerr << "\nor a greater value up to 32768 and try again.\n"; + } + } + if (verbose_mode) +@@ -502,13 +522,13 @@ usage: + uint32 minutes = (uint32)(playtime / 60.0); + uint32 seconds = (uint32)playtime - minutes * 60; + uint32 centiseconds = (uint32)((playtime - (real)(minutes * 60) - (real)seconds) * 100.0); +- cerr << "end of stream, playtime: " << minutes << ':'; +- cerr.width (2); +- cerr.fill ('0'); +- cerr << seconds << '.'; +- cerr.width (2); +- cerr.fill ('0'); +- cerr << centiseconds << '\n'; ++ std::cerr << "end of stream, playtime: " << minutes << ':'; ++ std::cerr.width (2); ++ std::cerr.fill ('0'); ++ std::cerr << seconds << '.'; ++ std::cerr.width (2); ++ std::cerr.fill ('0'); ++ std::cerr << centiseconds << '\n'; + } + + return 0; diff --git a/audio/maplay/patches/patch-ai b/audio/maplay/patches/patch-ai index f013e2a2b2f..eb4c54b271b 100644 --- a/audio/maplay/patches/patch-ai +++ b/audio/maplay/patches/patch-ai @@ -1,8 +1,91 @@ -$NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ +$NetBSD: patch-ai,v 1.2 2011/11/22 20:57:35 wiz Exp $ ---- obuffer.cc 2002/06/27 15:41:04 1.1 -+++ obuffer.cc 2002/06/27 15:41:40 -@@ -217,10 +217,10 @@ +--- obuffer.cc.orig 1994-06-27 11:14:03.000000000 +0000 ++++ obuffer.cc +@@ -47,7 +47,7 @@ + #include <unistd.h> + #include <fcntl.h> + #include <sys/ioctl.h> +-#include <iostream.h> ++#include <iostream> + #include "obuffer.h" + #include "header.h" + #ifdef ULAW +@@ -65,14 +65,14 @@ FileObuffer::FileObuffer (uint32 number_ + #ifdef DEBUG + if (!number_of_channels || number_of_channels > MAXCHANNELS) + { +- cerr << "FileObuffer: number of channels has to be in [1, " << MAXCHANNELS << "] !\n"; ++ std::cerr << "FileObuffer: number of channels has to be in [1, " << MAXCHANNELS << "] !\n"; + exit (1); + } + #endif + + #ifdef ULAW + if (number_of_channels > 1) +- cerr << "Are you sure you need stereo u-law output?\n"; ++ std::cerr << "Are you sure you need stereo u-law output?\n"; + #endif + channels = number_of_channels; + for (int i = 0; i < number_of_channels; ++i) +@@ -85,12 +85,12 @@ void FileObuffer::append (uint32 channel + #ifdef DEBUG + if (channel >= channels) + { +- cerr << "illegal channelnumber in FileObuffer::append()!\n"; ++ std::cerr << "illegal channelnumber in FileObuffer::append()!\n"; + exit (1); + } + if (bufferp[channel] - buffer >= OBUFFERSIZE) + { +- cerr << "FileObuffer: buffer overflow!\n"; ++ std::cerr << "FileObuffer: buffer overflow!\n"; + exit (1); + } + #endif +@@ -143,7 +143,7 @@ IndigoObuffer::IndigoObuffer (uint32 num + #ifdef DEBUG + if (!number_of_channels || number_of_channels > MAXCHANNELS) + { +- cerr << "IndigoObuffer: number of channels has to be in [1, " << MAXCHANNELS << "] !\n"; ++ std::cerr << "IndigoObuffer: number of channels has to be in [1, " << MAXCHANNELS << "] !\n"; + exit (1); + } + #endif +@@ -155,7 +155,7 @@ IndigoObuffer::IndigoObuffer (uint32 num + ALconfig config; + if (!(config = ALnewconfig ())) + { +- cerr << "ALnewconfig failed!\n"; ++ std::cerr << "ALnewconfig failed!\n"; + exit (1); + } + ALsetwidth (config, AL_SAMPLE_16); +@@ -165,7 +165,7 @@ IndigoObuffer::IndigoObuffer (uint32 num + ALsetchannels (config, AL_STEREO); + if (!(port = ALopenport ("MPEG audio player", "w", config))) + { +- cerr << "can't allocate an audio port!\n"; ++ std::cerr << "can't allocate an audio port!\n"; + exit (1); + } + +@@ -190,12 +190,12 @@ void IndigoObuffer::append (uint32 chann + #ifdef DEBUG + if (channel >= channels) + { +- cerr << "illegal channelnumber in IndigoObuffer::append()!\n"; ++ std::cerr << "illegal channelnumber in IndigoObuffer::append()!\n"; + exit (1); + } + if (bufferp[channel] - buffer >= OBUFFERSIZE) + { +- cerr << "IndigoObuffer: buffer overflow!\n"; ++ std::cerr << "IndigoObuffer: buffer overflow!\n"; + exit (1); + } + #endif +@@ -217,17 +217,17 @@ void IndigoObuffer::write_buffer (int) int SparcObuffer::audio_fd = -1; #ifdef ULAW @@ -15,7 +98,66 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ #endif { #ifndef ULAW -@@ -406,9 +406,9 @@ + #ifdef DEBUG + if (!number_of_channels || number_of_channels > MAXCHANNELS) + { +- cerr << "SparcObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; ++ std::cerr << "SparcObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; + exit (1); + } + #endif +@@ -235,7 +235,7 @@ SparcObuffer::SparcObuffer (uint32 numbe + + if (audio_fd < 0) + { +- cerr << "Internal error: SparcObuffer::audio_fd has to be initialized\n" ++ std::cerr << "Internal error: SparcObuffer::audio_fd has to be initialized\n" + "by SparcObuffer::class_suitable()!\n"; + exit (1); + } +@@ -296,7 +296,7 @@ void SparcObuffer::append (uint32 channe + #ifdef DEBUG + if (bufferp - buffer >= OBUFFERSIZE >> 1) + { +- cerr << "SparcObuffer: buffer overflow!\n"; ++ std::cerr << "SparcObuffer: buffer overflow!\n"; + exit (1); + } + #endif +@@ -307,12 +307,12 @@ void SparcObuffer::append (uint32 channe + #ifdef DEBUG + if (channel >= channels) + { +- cerr << "illegal channelnumber in SparcObuffer::append()!\n"; ++ std::cerr << "illegal channelnumber in SparcObuffer::append()!\n"; + exit (1); + } + if (bufferp[channel] - buffer >= OBUFFERSIZE) + { +- cerr << "SparcObuffer: buffer overflow!\n"; ++ std::cerr << "SparcObuffer: buffer overflow!\n"; + exit (1); + } + #endif +@@ -351,7 +351,7 @@ int SparcObuffer::open_audio_device (voi + if ((fd = open ("/dev/audio", O_WRONLY | O_NDELAY, 0)) < 0) + if (errno == EBUSY) + { +- cerr << "Sorry, the audio device is busy!\n"; ++ std::cerr << "Sorry, the audio device is busy!\n"; + exit (1); + } + else +@@ -398,7 +398,7 @@ int SparcObuffer::get_device_type (int f + } + return devtype; + #else +- cerr << "SparcObuffer::get_device_type(): AUDIO_GETDEV ioctl not available!\n"; ++ std::cerr << "SparcObuffer::get_device_type(): AUDIO_GETDEV ioctl not available!\n"; + return -1; + #endif + } +@@ -406,15 +406,15 @@ int SparcObuffer::get_device_type (int f #ifdef ULAW @@ -27,7 +169,77 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ #endif { #ifdef ULAW -@@ -537,6 +537,7 @@ + if (number_of_channels > 1) + { +- cerr << "Your audio hardware cannot handle more than one audio channel.\n" ++ std::cerr << "Your audio hardware cannot handle more than one audio channel.\n" + "Please use the option -l or -r for stereo streams.\n"; + return False; + } +@@ -436,7 +436,7 @@ bool SparcObuffer::class_suitable (void) + return True; + else if (!strcmp (devtype.name, "SUNW,dbri")) + { +- cerr << "Your machine can produce CD-quality audio output,\n" ++ std::cerr << "Your machine can produce CD-quality audio output,\n" + "but this binary was compiled for 8 kHz u-law ouput. (telephone quality)\n" + "Please recompile it without the ULAW define in COMPILERFLAGS.\n" + "(or use the -amd option to use this binary with low-quality output)\n"; +@@ -448,7 +448,7 @@ bool SparcObuffer::class_suitable (void) + return True; + else if (!strcmp (devtype.name, "SUNW,am79c30")) + { +- cerr << "Your machine can produce 8 kHz u-law audio output only,\n" ++ std::cerr << "Your machine can produce 8 kHz u-law audio output only,\n" + "but this binary was compiled for CD-quality output.\n" + "Please recompile it with ULAW defined in COMPILERFLAGS\n" + "or use it in stdout mode as an decoder only.\n"; +@@ -464,7 +464,7 @@ bool SparcObuffer::class_suitable (void) + # ifdef ULAW + return True; + # else +- cerr << "Your machine can produce 8 kHz u-law audio output only,\n" ++ std::cerr << "Your machine can produce 8 kHz u-law audio output only,\n" + "but this binary was compiled for CD-quality output.\n" + "Please recompile it with ULAW defined in COMPILERFLAGS\n" + "or use it in stdout mode as an decoder only.\n"; +@@ -479,7 +479,7 @@ bool SparcObuffer::class_suitable (void) + return True; + else if (device_type == AUDIO_DEV_SPEAKERBOX) + { +- cerr << "Your machine can produce CD-quality audio output,\n" ++ std::cerr << "Your machine can produce CD-quality audio output,\n" + "but this binary was compiled for 8 kHz u-law ouput. (telephone quality)\n" + "Please recompile it without the ULAW define in COMPILERFLAGS.\n" + "(or use the -amd option to use this binary with low-quality output)\n"; +@@ -491,7 +491,7 @@ bool SparcObuffer::class_suitable (void) + return True; + else if (device_type == AUDIO_DEV_AMD) + { +- cerr << "Your machine can produce 8 kHz u-law audio output only,\n" ++ std::cerr << "Your machine can produce 8 kHz u-law audio output only,\n" + "but this binary was compiled for CD-quality output.\n" + "Please recompile it with ULAW defined in COMPILERFLAGS\n" + "or use it in stdout mode as an decoder only.\n"; +@@ -504,7 +504,7 @@ bool SparcObuffer::class_suitable (void) + + #ifndef SunOS4_1_1 + close (audio_fd); +- cerr << "Sorry, I don't recognize your audio device.\n" ++ std::cerr << "Sorry, I don't recognize your audio device.\n" + # ifdef ULAW + "Please try the -amd option or use the stdout mode.\n"; + # else +@@ -527,7 +527,7 @@ int LinuxObuffer::open_audio_device (voi + if ((fd = open ("/dev/dsp", O_WRONLY | O_NDELAY, 0)) < 0) + if (errno == EBUSY) + { +- cerr << "Sorry, the audio device is busy!\n"; ++ std::cerr << "Sorry, the audio device is busy!\n"; + exit (1); + } + else +@@ -537,6 +537,7 @@ int LinuxObuffer::open_audio_device (voi } // turn NDELAY mode off: @@ -35,7 +247,7 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ int flags; if ((flags = fcntl (fd, F_GETFL, 0)) < 0) { -@@ -549,6 +550,7 @@ +@@ -549,6 +550,7 @@ int LinuxObuffer::open_audio_device (voi perror ("fcntl F_SETFL on /dev/audio failed"); exit (1); } @@ -43,7 +255,40 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ return fd; } -@@ -629,7 +631,7 @@ +@@ -558,7 +560,7 @@ LinuxObuffer::LinuxObuffer (uint32 numbe + #ifdef DEBUG + if (!number_of_channels || number_of_channels > MAXCHANNELS) + { +- cerr << "LinuxObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; ++ std::cerr << "LinuxObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; + exit (1); + } + #endif +@@ -568,7 +570,7 @@ LinuxObuffer::LinuxObuffer (uint32 numbe + + if (audio_fd < 0) + { +- cerr << "Internal error, LinuxObuffer::audio_fd has to be initialized\n" ++ std::cerr << "Internal error, LinuxObuffer::audio_fd has to be initialized\n" + "by LinuxObuffer::class_suitable()!\n"; + exit (1); + } +@@ -602,12 +604,12 @@ void LinuxObuffer::append (uint32 channe + #ifdef DEBUG + if (channel >= channels) + { +- cerr << "illegal channelnumber in LinuxObuffer::append()!\n"; ++ std::cerr << "illegal channelnumber in LinuxObuffer::append()!\n"; + exit (1); + } + if (bufferp[channel] - buffer >= OBUFFERSIZE) + { +- cerr << "buffer overflow!\n"; ++ std::cerr << "buffer overflow!\n"; + exit (1); + } + #endif +@@ -629,7 +631,7 @@ void LinuxObuffer::write_buffer (int) } @@ -52,7 +297,7 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ { // open the dsp audio device: audio_fd = open_audio_device (); -@@ -637,3 +639,122 @@ +@@ -637,3 +639,122 @@ bool LinuxObuffer::class_suitable (uint3 } #endif /* LINUX */ @@ -67,7 +312,7 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ + if ((fd = open ("/dev/audio", O_WRONLY | O_NDELAY, 0)) < 0) + if (errno == EBUSY) + { -+ cerr << "Sorry, the audio device is busy!\n"; ++ std::cerr << "Sorry, the audio device is busy!\n"; + exit (1); + } + else @@ -97,7 +342,7 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ +#ifdef DEBUG + if (!number_of_channels || number_of_channels > MAXCHANNELS) + { -+ cerr << "NetBSDObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; ++ std::cerr << "NetBSDObuffer: 0 < number of channels < " << MAXCHANNELS << "!\n"; + exit (1); + } +#endif @@ -107,7 +352,7 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ + + if (audio_fd < 0) + { -+ cerr << "Internal error, NetBSDObuffer::audio_fd has to be initialized\n" ++ std::cerr << "Internal error, NetBSDObuffer::audio_fd has to be initialized\n" + "by NetBSDObuffer::class_suitable()!\n"; + exit (1); + } @@ -140,12 +385,12 @@ $NetBSD: patch-ai,v 1.1 2002/06/27 15:52:19 agc Exp $ +#ifdef DEBUG + if (channel >= channels) + { -+ cerr << "illegal channelnumber in NetBSDObuffer::append()!\n"; ++ std::cerr << "illegal channelnumber in NetBSDObuffer::append()!\n"; + exit (1); + } + if (bufferp[channel] - buffer >= OBUFFERSIZE) + { -+ cerr << "buffer overflow!\n"; ++ std::cerr << "buffer overflow!\n"; + exit (1); + } +#endif diff --git a/audio/maplay/patches/patch-aj b/audio/maplay/patches/patch-aj index cf9d0731cda..cfb034cc39a 100644 --- a/audio/maplay/patches/patch-aj +++ b/audio/maplay/patches/patch-aj @@ -1,8 +1,17 @@ -$NetBSD: patch-aj,v 1.1 2002/06/27 15:52:19 agc Exp $ +$NetBSD: patch-aj,v 1.2 2011/11/22 20:57:35 wiz Exp $ ---- obuffer.h 2002/06/27 15:41:04 1.1 -+++ obuffer.h 2002/06/27 15:41:40 -@@ -123,20 +123,20 @@ +--- obuffer.h.orig 1994-06-23 12:14:40.000000000 +0000 ++++ obuffer.h +@@ -27,7 +27,7 @@ + #ifndef OBUFFER_H + #define OBUFFER_H + +-#include <iostream.h> ++#include <iostream> + #include <unistd.h> + #include <stdlib.h> + #include "all.h" +@@ -123,20 +123,20 @@ private: public: #ifdef ULAW @@ -27,7 +36,7 @@ $NetBSD: patch-aj,v 1.1 2002/06/27 15:52:19 agc Exp $ // returnvalue == False: no 16-bit output possible (class unsuitable) #endif }; -@@ -159,7 +159,27 @@ +@@ -159,7 +159,27 @@ public: void append (uint32 channel, int16 value); void write_buffer (int dummy); diff --git a/audio/maplay/patches/patch-al b/audio/maplay/patches/patch-al index 34f2afa2e46..bfa248c4d67 100644 --- a/audio/maplay/patches/patch-al +++ b/audio/maplay/patches/patch-al @@ -1,8 +1,17 @@ -$NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ +$NetBSD: patch-al,v 1.3 2011/11/22 20:57:35 wiz Exp $ ---- subband_layer_1.cc.orig 1994-06-23 14:14:36.000000000 +0200 +--- subband_layer_1.cc.orig 1994-06-23 12:14:36.000000000 +0000 +++ subband_layer_1.cc -@@ -86,7 +86,7 @@ void SubbandLayer1::read_scalefactor (Ib +@@ -67,7 +67,7 @@ SubbandLayer1::SubbandLayer1 (uint32 sub + void SubbandLayer1::read_allocation (Ibitstream *stream, Header *, Crc16 *crc) + { + if ((allocation = stream->get_bits (4)) == 15) +- cerr << "WARNING: stream contains an illegal allocation!\n"; // MPEG-stream is corrupted! ++ std::cerr << "WARNING: stream contains an illegal allocation!\n"; // MPEG-stream is corrupted! + if (crc) + crc->add_bits (allocation, 4); + if (allocation) +@@ -86,14 +86,14 @@ void SubbandLayer1::read_scalefactor (Ib } @@ -11,7 +20,15 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ { if (allocation) { -@@ -105,10 +105,10 @@ bool SubbandLayer1::read_sampledata (Ibi + sample = real (stream->get_bits (samplelength)); + #ifdef DEBUG + if (sample == (1 << samplelength) - 1) +- cerr << "WARNING: stream contains an illegal subband sample!\n"; // MPEG-stream is corrupted! ++ std::cerr << "WARNING: stream contains an illegal subband sample!\n"; // MPEG-stream is corrupted! + #endif + } + if (++samplenumber == 12) +@@ -105,15 +105,15 @@ bool SubbandLayer1::read_sampledata (Ibi } @@ -24,6 +41,12 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ { register real scaled_sample = (sample * factor + offset) * scalefactor; #ifdef DEBUG + if (scaled_sample < -1.0 || scaled_sample > 1.0) +- cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; ++ std::cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; + // this should never occur + #endif + filter1->input_sample (scaled_sample, subbandnumber); @@ -142,7 +142,7 @@ void SubbandLayer1IntensityStereo::read_ } @@ -33,7 +56,14 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ SynthesisFilter *filter1, SynthesisFilter *filter2) { if (allocation) -@@ -160,7 +160,7 @@ bool SubbandLayer1IntensityStereo::put_n +@@ -154,18 +154,18 @@ bool SubbandLayer1IntensityStereo::put_n + sample2 = sample * channel2_scalefactor; + #ifdef DEBUG + if (sample1 < -1.0 || sample1 > 1.0 || sample2 < -1.0 || sample2 > 1.0) +- cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; ++ std::cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; + // this should never occur + #endif filter1->input_sample (sample1, subbandnumber); filter2->input_sample (sample2, subbandnumber); } @@ -42,7 +72,31 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ { register real sample1 = sample * scalefactor; #ifdef DEBUG -@@ -231,9 +231,9 @@ void SubbandLayer1Stereo::read_scalefact + if (sample1 < -1.0 || sample1 > 1.0) +- cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; ++ std::cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; + // this should never occur + #endif + filter1->input_sample (sample1, subbandnumber); +@@ -175,7 +175,7 @@ bool SubbandLayer1IntensityStereo::put_n + register real sample2 = sample * channel2_scalefactor; + #ifdef DEBUG + if (sample2 < -1.0 || sample2 > 1.0) +- cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; ++ std::cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; + // this should never occur + #endif + filter1->input_sample (sample2, subbandnumber); +@@ -206,7 +206,7 @@ void SubbandLayer1Stereo::read_allocatio + crc->add_bits (channel2_allocation, 4); + } + if (allocation == 15 || channel2_allocation == 15) +- cerr << "WARNING: stream contains an illegal allocation!\n"; // MPEG-stream is corrupted! ++ std::cerr << "WARNING: stream contains an illegal allocation!\n"; // MPEG-stream is corrupted! + if (allocation) + { + samplelength = allocation + 1; +@@ -231,32 +231,32 @@ void SubbandLayer1Stereo::read_scalefact } @@ -54,7 +108,13 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ if (channel2_allocation) { channel2_sample = real (stream->get_bits (channel2_samplelength)); -@@ -246,11 +246,11 @@ bool SubbandLayer1Stereo::read_sampledat + #ifdef DEBUG + if (channel2_sample == (1 << channel2_samplelength) - 1) +- cerr << "WARNING: stream contains an illegal subband sample!\n"; // MPEG-stream is corrupted! ++ std::cerr << "WARNING: stream contains an illegal subband sample!\n"; // MPEG-stream is corrupted! + #endif + } + return returnvalue; } @@ -68,3 +128,10 @@ $NetBSD: patch-al,v 1.2 2004/01/18 13:59:25 mrauch Exp $ { register float sample2 = (channel2_sample * channel2_factor + channel2_offset) * channel2_scalefactor; + #ifdef DEBUG + if (sample2 < -1.0 || sample2 > 1.0) +- cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; ++ std::cerr << "WARNING: rescaled subband sample is not in [-1.0, 1.0]\n"; + // this should never occur + #endif + if (channels == both) diff --git a/audio/maplay/patches/patch-crc.cc b/audio/maplay/patches/patch-crc.cc new file mode 100644 index 00000000000..e3c38902721 --- /dev/null +++ b/audio/maplay/patches/patch-crc.cc @@ -0,0 +1,13 @@ +$NetBSD: patch-crc.cc,v 1.1 2011/11/22 20:57:35 wiz Exp $ + +--- crc.cc.orig 1994-06-23 12:14:35.000000000 +0000 ++++ crc.cc +@@ -18,7 +18,7 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +-#include <iostream.h> ++#include <iostream> + #include <stdlib.h> + #include "crc.h" + diff --git a/audio/maplay/patches/patch-synthesis__filter.h b/audio/maplay/patches/patch-synthesis__filter.h new file mode 100644 index 00000000000..25da148500f --- /dev/null +++ b/audio/maplay/patches/patch-synthesis__filter.h @@ -0,0 +1,13 @@ +$NetBSD: patch-synthesis__filter.h,v 1.1 2011/11/22 20:57:35 wiz Exp $ + +--- synthesis_filter.h.orig 1994-06-23 12:14:40.000000000 +0000 ++++ synthesis_filter.h +@@ -21,7 +21,7 @@ + #ifndef SYNTHESIS_FILTER_H + #define SYNTHESIS_FILTER_H + +-#include <iostream.h> ++#include <iostream> + #include "all.h" + #include "obuffer.h" + |