From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../wavsplit/files/wavsplit-1.2.1-64bit.patch | 69 ++++++++ .../wavsplit/files/wavsplit-1.2.1-Makefile.patch | 23 +++ .../files/wavsplit-1.2.1-large-files.patch | 193 +++++++++++++++++++++ 3 files changed, 285 insertions(+) create mode 100644 media-sound/wavsplit/files/wavsplit-1.2.1-64bit.patch create mode 100644 media-sound/wavsplit/files/wavsplit-1.2.1-Makefile.patch create mode 100644 media-sound/wavsplit/files/wavsplit-1.2.1-large-files.patch (limited to 'media-sound/wavsplit/files') diff --git a/media-sound/wavsplit/files/wavsplit-1.2.1-64bit.patch b/media-sound/wavsplit/files/wavsplit-1.2.1-64bit.patch new file mode 100644 index 000000000000..abfaf424113b --- /dev/null +++ b/media-sound/wavsplit/files/wavsplit-1.2.1-64bit.patch @@ -0,0 +1,69 @@ +--- bak/wavsplit.c 2006-11-24 17:53:36.056883000 +0100 ++++ wavsplit.c 2006-11-24 17:52:38.345276250 +0100 +@@ -403,7 +403,7 @@ + ptr += 4; /* we move past fmt_ */ + memcpy (&waveformat, ptr, sizeof (WAVEFORMAT)); + +- if (waveformat.dwSize < (sizeof (WAVEFORMAT) - sizeof (u_long))) { ++ if (waveformat.dwSize < (sizeof (WAVEFORMAT) - sizeof (u_int))) { + fprintf (stderr, "Bad format: Bad fmt size\n"); + return 1; + } +@@ -423,7 +423,7 @@ + } + + ptr += 4; /* we move past data */ +- memcpy (&databytes, ptr, sizeof (u_long)); ++ memcpy (&databytes, ptr, sizeof (u_int)); + + struct stat stat_buf; + +@@ -446,7 +446,7 @@ + + if (verbose) { + printf ("Channels: %d\n", waveformat.wChannels); +- printf ("Samplerate: %ldHz\n", waveformat.dwSamplesPerSec); ++ printf ("Samplerate: %dHz\n", waveformat.dwSamplesPerSec); + printf ("Samplebits: %d\n", waveformat.wBitsPerSample); + printf ("Databytes: %llu\n\n", databytes); + printf ("Split Hours Mins Seconds Bytes %%\n"); +--- bak/wavsplit.h 2006-11-24 17:53:36.056883000 +0100 ++++ wavsplit.h 2006-11-24 17:43:58.648797250 +0100 +@@ -46,29 +46,29 @@ + } TIMEFORMAT; + + typedef struct { +- u_long dwSize; ++ u_int dwSize; + u_short wFormatTag; + u_short wChannels; +- u_long dwSamplesPerSec; +- u_long dwAvgBytesPerSec; ++ u_int dwSamplesPerSec; ++ u_int dwAvgBytesPerSec; + u_short wBlockAlign; + u_short wBitsPerSample; + } WAVEFORMAT; + + typedef struct { + char RiffID[4]; +- u_long RiffSize; ++ u_int RiffSize; + char WaveID[4]; + char FmtID[4]; +- u_long FmtSize; ++ u_int FmtSize; + u_short wFormatTag; + u_short nChannels; +- u_long nSamplesPerSec; +- u_long nAvgBytesPerSec; ++ u_int nSamplesPerSec; ++ u_int nAvgBytesPerSec; + u_short nBlockAlign; + u_short wBitsPerSample; + char DataID[4]; +- u_long nDataBytes; ++ u_int nDataBytes; + } WAVE_HEADER; + + typedef struct { diff --git a/media-sound/wavsplit/files/wavsplit-1.2.1-Makefile.patch b/media-sound/wavsplit/files/wavsplit-1.2.1-Makefile.patch new file mode 100644 index 000000000000..a4b35a64fefe --- /dev/null +++ b/media-sound/wavsplit/files/wavsplit-1.2.1-Makefile.patch @@ -0,0 +1,23 @@ +--- Makefile.old 2006-03-30 08:54:03.000000000 +0200 ++++ Makefile 2006-03-30 08:55:04.000000000 +0200 +@@ -6,16 +6,16 @@ + version = 1.2.1 + + CC = gcc +-CFLAGS = -Wall +-LDFLAGS = -lm ++CFLAGS += -Wall ++LIBS = -lm + + all: wavsplit wavren + + wavsplit: wavsplit.c wavsplit.h +- gcc $(CFLAGS) wavsplit.c $(LDFLAGS) -o $@ ++ $(CC) $(CFLAGS) wavsplit.c $(LIBS) $(LDFLAGS) -o $@ + + wavren: wavren.c +- gcc $(CFLAGS) wavren.c -o $@ ++ $(CC) $(CFLAGS) wavren.c $(LDFLAGS) -o $@ + + install: + cp wavsplit $(BIN) diff --git a/media-sound/wavsplit/files/wavsplit-1.2.1-large-files.patch b/media-sound/wavsplit/files/wavsplit-1.2.1-large-files.patch new file mode 100644 index 000000000000..ff27231be65e --- /dev/null +++ b/media-sound/wavsplit/files/wavsplit-1.2.1-large-files.patch @@ -0,0 +1,193 @@ +--- Makefile 2004-11-17 23:19:17.000000000 +0100 ++++ Makefile 2005-01-16 21:23:33.000000000 +0100 +@@ -6,7 +6,7 @@ + version = 1.2.1 + + CC = gcc +-CFLAGS += -Wall ++CFLAGS += -Wall -D_FILE_OFFSET_BITS=64 + LIBS = -lm + + all: wavsplit wavren +--- wavsplit.c 2004-11-17 23:19:17.000000000 +0100 ++++ wavsplit.c 2005-01-16 22:04:39.000000000 +0100 +@@ -269,9 +269,9 @@ + timepos * split) + { + char *buf, *bp_out; +- long to_write, to_read, n_read, pos; ++ off_t to_write, to_read, n_read, pos; + int fnr = 0; +- unsigned long in_blk_size; ++ off_t in_blk_size; + struct stat stat_buf; + + /* Buffer reservieren */ +@@ -282,8 +282,8 @@ + in_blk_size = stat_buf.st_blksize; + buf = malloc (in_blk_size + 1); + if (buf == NULL) { +- fprintf (stderr, "Could not allocate %ld bytes of memory.\n", +- in_blk_size + 1); ++ fprintf (stderr, "Could not allocate %llu bytes of memory.\n", ++ (in_blk_size + 1)); + return 1; + } + /* if (verbose) printf("Allocated %ld bytes for buffer.\n", in_blk_size+1); */ +@@ -295,7 +295,7 @@ + return 1; + + do { +- n_read = (long) stdread (buf, in_blk_size + 1); ++ n_read = stdread (buf, in_blk_size + 1); + if (n_read < 0) { + fprintf (stderr, "Error while reading.\n"); + return 1; +@@ -336,7 +336,7 @@ + else { + if (verbose) + printf +- ("[%02d]\tuntil the end %12ld 100.00%%\n", ++ ("[%02d]\tuntil the end %12llu 100.00%%\n", + fnr + 1, databytes); + } + } +@@ -374,7 +374,7 @@ + int readheader () + { + char ibuffer[BUFFERSIZE]; +- u_long offset; ++ off_t offset; + + if (lseek (ifd, 0L, SEEK_SET)) { + fprintf (stderr, "Could not locate beginning of input file\n"); +@@ -425,9 +425,22 @@ + ptr += 4; /* we move past data */ + memcpy (&databytes, ptr, sizeof (u_long)); + +- offset = (u_long) ptr + 4 - (u_long) ibuffer; ++ struct stat stat_buf; ++ ++ /* Buffer reservieren */ ++ if (fstat (ifd, &stat_buf) < 0) { ++ fprintf (stderr, "Could not read input file state.\n"); ++ return 1; ++ } ++ if(stat_buf.st_size > databytes) { ++ printf("Actual size of file (%llu) is larger than the databytes (%llu), setting to actual size: %llu!\n", ++ stat_buf.st_size, databytes + (ptr - ibuffer) + 4, stat_buf.st_size - (ptr - ibuffer) - 4 ); ++ databytes = stat_buf.st_size - (ptr - ibuffer) - 4 ; ++ } ++ ++ offset = ptr + 4 - ibuffer; + if (lseek (ifd, offset, SEEK_SET) == -1) { +- fprintf (stderr, "Error seeking to WAV data at %lu\n", offset); ++ fprintf (stderr, "Error seeking to WAV data at %llu\n", offset); + return 1; + } + +@@ -435,7 +448,7 @@ + printf ("Channels: %d\n", waveformat.wChannels); + printf ("Samplerate: %ldHz\n", waveformat.dwSamplesPerSec); + printf ("Samplebits: %d\n", waveformat.wBitsPerSample); +- printf ("Databytes: %ld\n\n", databytes); ++ printf ("Databytes: %llu\n\n", databytes); + printf ("Split Hours Mins Seconds Bytes %%\n"); + //printf("Blocks: %ld\n",databytes/waveformat.wBlockAlign); + } +@@ -473,7 +486,7 @@ + return NULL; + } + +-int createout (int num, long datasize) ++int createout (int num, off_t datasize) + { + char ofile[MAX_PATH + 1]; + sprintf (ofile, "%s/%02d.wav", basename, num); +@@ -517,7 +530,7 @@ + TimeFloat = hr* 3600.0 + min * 60.0 + sek + (frames/fps); + + */ +-long calcsplit (unsigned int UseHours, unsigned int UseFrames, ++off_t calcsplit (unsigned int UseHours, unsigned int UseFrames, + unsigned int fps, unsigned int UseTrackLens, + int splitnr, timepos * split) + { +@@ -526,7 +539,7 @@ + + double TimeFloat = 0.0; + double SplitTimeFloat = 0.0; +- long pos; ++ off_t pos; + unsigned int Opt = 2 * UseHours + UseFrames; + + switch (Opt) { +@@ -569,7 +582,7 @@ + /* first calculate to the nearest sample, then scale by the */ + /* block size to avoid getting e.g. half a block */ + +- pos = (long) ((SplitTimeFloat * (double) waveformat.dwSamplesPerSec)); ++ pos = (off_t) ((SplitTimeFloat * (double) waveformat.dwSamplesPerSec)); + pos = pos * waveformat.wBlockAlign; + + if (verbose) { +@@ -581,24 +594,24 @@ + } + } + if (UseFrames) +- printf ("%5d %8.3f %12ld %3.2f%%\n", ++ printf ("%5d %8.3f %12llu %3.2f%%\n", + split[splitnr].min, + (double) split[splitnr].seki + + ((double) split[splitnr].frames / (double) fps), pos, + (float) pos / (float) databytes * 100); + + else +- printf ("%5d %8.3f %12ld %3.2f%%\n", ++ printf ("%5d %8.3f %12llu %3.2f%%\n", + split[splitnr].min, + split[splitnr].sek, pos, (float) pos / (float) databytes * 100); + + return pos; + } + +-long stdread (char *buf, long nchars) ++off_t stdread (char *buf, off_t nchars) + { +- int n_read; +- int to_be_read = nchars; ++ off_t n_read; ++ off_t to_be_read = nchars; + + while (to_be_read) { + n_read = read (ifd, buf, to_be_read); +--- wavsplit.h 2004-11-17 23:19:17.000000000 +0100 ++++ wavsplit.h 2005-01-16 21:23:33.000000000 +0100 +@@ -121,15 +121,15 @@ + static int split (unsigned int UseHours, unsigned int UseFrames, + unsigned int fps, unsigned int UseTrackLens, + int splits, timepos * splitpos); +-static long calcsplit (unsigned int UseHours, unsigned int UseFrames, ++static off_t calcsplit (unsigned int UseHours, unsigned int UseFrames, + unsigned int fps, unsigned int UseTrackLens, + int splitnr, timepos * split); +-static int createout (); ++static int createout (int num, off_t datasize); + int closeout (); + void display (unsigned char avgleft, unsigned char avgright, + unsigned char avgloud); + static void usage (); +-static long stdread (char *buf, long nchars); ++static off_t stdread (char *buf, off_t nchars); + #ifdef __powerpc__ + static _ConvertHeaderFromNative (WAVE_HEADER * hdr); + static _ConvertHeaderToNative (WAVE_HEADER * hdr); +@@ -137,7 +137,7 @@ + + static char *ptr; + static WAVEFORMAT waveformat; +-static u_long databytes, b; ++static off_t databytes, b; + static int ifd, ofd; + static int verbose; + static char basename[MAX_PATH + 1], ifile[MAX_PATH + 1]; -- cgit v1.2.3