summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-video/mpeg-tools/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-video/mpeg-tools/files')
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-64bit_fixes.patch286
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-as-needed.patch47
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-build.patch56
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-jpeg.patch56
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-powerpc.patch20
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg-7.patch26
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg.patch38
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-convert.patch169
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-mpeg-encode.patch87
-rw-r--r--media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-tests.patch204
10 files changed, 989 insertions, 0 deletions
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-64bit_fixes.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-64bit_fixes.patch
new file mode 100644
index 000000000000..fa2e70304dbe
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-64bit_fixes.patch
@@ -0,0 +1,286 @@
+--- work/convert/eyuvtojpeg.c
++++ work/convert/eyuvtojpeg.c
+@@ -22,6 +22,7 @@
+ /*==============*
+ * HEADER FILES *
+ *==============*/
++#include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <malloc.h>
+@@ -43,7 +44,7 @@
+ void AllocYCC(void);
+
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ FILE *fpointer;
+ char command[256];
+@@ -105,6 +106,7 @@
+ fprintf(stdout, "Converting to JPEG %s\n", dest);
+ sprintf(command, "cjpeg /tmp/foobar > %s", dest);
+ system(command);
++ return 0;
+ }
+
+
+--- work/convert/eyuvtoppm.c
++++ work/convert/eyuvtoppm.c
+@@ -22,6 +22,7 @@
+ /*==============*
+ * HEADER FILES *
+ *==============*/
++#include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <malloc.h>
+@@ -43,7 +44,7 @@
+ void AllocYCC(void);
+
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ FILE *fpointer;
+ char src[256], dest[256];
+@@ -109,7 +110,7 @@
+
+ WritePPM(fpointer);
+ fclose(fpointer);
+-
++ return 0;
+ }
+
+ void Usage(void)
+--- work/convert/mtv/archdep.h
++++ work/convert/mtv/archdep.h
+@@ -45,16 +45,46 @@
+ ((char *)(to))[5] = ((char *)(from))[2]; \
+ ((char *)(to))[6] = ((char *)(from))[1]; \
+ ((char *)(to))[7] = ((char *)(from))[0];
+-#endif /*little-endian*/
++#endif /*little-endian 32bit*/
++
++#if defined (__x86_64)
++#define DECODE_SHORT(from, to) \
++ ((char *)(to))[0] = ((char *)(from))[1]; \
++ ((char *)(to))[1] = ((char *)(from))[0];
++#define DECODE_INT(from, to) \
++ ((char *)(to))[0] = ((char *)(from))[3]; \
++ ((char *)(to))[1] = ((char *)(from))[2]; \
++ ((char *)(to))[2] = ((char *)(from))[1]; \
++ ((char *)(to))[3] = ((char *)(from))[0];
++
++#define DECODE_LONG(from, to) \
++ ((char *)(to))[0] = ((char *)(from))[7]; \
++ ((char *)(to))[1] = ((char *)(from))[6]; \
++ ((char *)(to))[2] = ((char *)(from))[5]; \
++ ((char *)(to))[3] = ((char *)(from))[4]; \
++ ((char *)(to))[4] = ((char *)(from))[3]; \
++ ((char *)(to))[5] = ((char *)(from))[2]; \
++ ((char *)(to))[6] = ((char *)(from))[1]; \
++ ((char *)(to))[7] = ((char *)(from))[0];
++
++#define DECODE_FLOAT(from, to) DECODE_INT((to), (from))
++
++#define DECODE_DOUBLE(from, to) DECODE_LONG((to), (from))
++
++#endif /*little-endian, 64bit*/
+
+
+ /* Most architectures are symmetrical with respect to conversions. */
+-#if defined (mc68000) || defined (sparc) || defined (i386)
++#if defined (mc68000) || defined (sparc) || defined (i386) || defined(__x86_64)
+ #define ENCODE_SHORT(from, to) DECODE_SHORT((from), (to))
+ #define ENCODE_LONG(from, to) DECODE_LONG((from), (to))
+ #define ENCODE_FLOAT(from, to) DECODE_FLOAT((from), (to))
+ #define ENCODE_DOUBLE(from, to) DECODE_DOUBLE((from), (to))
+
++#if defined(__x86_64)
++#define ENCODE_INT(from, to) DECODE_INT((from), (to))
++#endif
++
+ /* Define types of specific length */
+ typedef char i_8;
+ typedef short i_16;
+--- work/convert/mtv/movieToVid.c
++++ work/convert/mtv/movieToVid.c
+@@ -295,7 +295,7 @@
+ exit (0);
+ }
+
+-void
++int
+ main (argc, argv)
+ int argc;
+ char **argv;
+@@ -326,4 +326,5 @@
+ WriteScriptFile (argv[1], argv[2], argv[3], argv[4],
+ &header, offsets, numFrames);
+ fprintf (stderr, "done\n");
++ return 0;
+ }
+--- work/convert/ppmtoeyuv.c
++++ work/convert/ppmtoeyuv.c
+@@ -39,6 +39,11 @@
+ * HEADER FILES *
+ *==============*/
+
++#include <malloc.h>
++#include <unistd.h>
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
+ #include <stdio.h>
+ #include "ansi.h"
+
+@@ -65,7 +66,7 @@
+ static void PPMtoYUV _ANSI_ARGS_((void));
+
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ if ( ! ReadPPM(stdin) )
+ {
+@@ -76,6 +77,7 @@
+ PPMtoYUV();
+
+ WriteYUV(stdout);
++ return 0;
+ }
+
+
+--- work/mpeg_encode/bitio.c
++++ work/mpeg_encode/bitio.c
+@@ -79,6 +79,8 @@
+ * HEADER FILES *
+ *==============*/
+
++#include <unistd.h>
++#include <time.h>
+ #include <assert.h>
+ #include "all.h"
+ #include "byteorder.h"
+--- work/mpeg_encode/jpeg.c
++++ work/mpeg_encode/jpeg.c
+@@ -65,6 +65,8 @@
+ *==============*/
+
+ #include <stdio.h>
++#include <sys/types.h>
++#include <unistd.h>
+ #include "all.h"
+ #include "mtypes.h"
+ #include "frames.h"
+--- work/mpeg_encode/headers/libpnmrw.h
++++ work/mpeg_encode/headers/libpnmrw.h
+@@ -20,9 +20,6 @@
+ ** that point here, feel free to tweak or remove these declarations.
+ */
+ #include <malloc.h>
+-#if !defined(sco) && !defined(sgi) && !defined(IRIX)
+-extern char* malloc();
+-#endif
+ /* End of configurable definitions. */
+
+
+--- work/mpeg_encode/libpnmrw.c
++++ work/mpeg_encode/libpnmrw.c
+@@ -27,6 +27,9 @@
+ /* #define MSDOS */
+ #endif
+
++#include <stdlib.h>
++#include <unistd.h>
++#include <errno.h>
+ #include <stdio.h>
+ #include "libpnmrw.h"
+
+@@ -128,11 +128,9 @@
+ pm_perror( reason )
+ char* reason;
+ {
+- extern char* sys_errlist[];
+- extern int errno;
+ char* e;
+
+- e = sys_errlist[errno];
++ e = strerror(errno);
+
+ if ( reason != 0 && reason[0] != '\0' )
+ (void) fprintf( stderr, "%s: %s - %s\n", progname, reason, e );
+@@ -361,7 +361,7 @@
+ int cols, format;
+ {
+ register int col, bitshift, b;
+- register int item;
++ register int item = 0;
+ register bit* bP;
+
+ switch ( format )
+--- work/mpeg_encode/opts.c
++++ work/mpeg_encode/opts.c
+@@ -35,6 +35,7 @@
+ * HEADER FILES *
+ *==============*/
+
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include "opts.h"
+--- work/mpeg_encode/iframe.c
++++ work/mpeg_encode/iframe.c
+@@ -235,6 +235,8 @@
+ int SetFCodeHelper _ANSI_ARGS_((int sr));
+ void CalcDistortion _ANSI_ARGS_((MpegFrame *current, int y, int x));
+
++void Mpost_UnQuantZigBlockLaplace _ANSI_ARGS_((FlatBlock in, Block out, int qscale, boolean iblock));
++
+ int
+ SetFCodeHelper(SR)
+ int SR;
+--- work/convert/jmovie2jpeg.c
++++ work/convert/jmovie2jpeg.c
+@@ -33,6 +33,9 @@
+ ************************************************************************/
+
+ #include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <unistd.h>
+
+ #define HEADER_SIZE 607 /*JFIF header size used on output images*/
+
+@@ -54,7 +54,6 @@
+ FILE *inFile; /* Jmovie file pointer */
+ FILE *outFile; /* JPEG file pointer for output file */
+ FILE *audiooutfile; /* SPARC .AU audio output file pointer*/
+- extern char *malloc();
+ int fd, i; /* input file descriptor and a counting variable*/
+ int start, end; /* first and last frames to be extracted */
+ char ofname[256]; /* output filename string */
+@@ -283,12 +283,12 @@
+ if (fread (&(image_offset),sizeof(int),1,inFile) != 1)
+ {
+ perror("Error in reading image offset");
+- exit();
++ exit(1);
+ }
+ if (fread (&(audio_tracks),sizeof(int),1,inFile) != 1)
+ {
+ perror("Error in reading audio tracks");
+- exit();
++ exit(1);
+ }
+ if (audio_tracks != 1)
+ {
+@@ -373,6 +373,7 @@
+ fclose(inFile);
+ fclose(audiooutfile);
+
++ return 0;
+ }
+
+
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-as-needed.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-as-needed.patch
new file mode 100644
index 000000000000..58c74e124f09
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-as-needed.patch
@@ -0,0 +1,47 @@
+--- convert/Makefile 2009-08-25 21:19:42.000000000 +0200
++++ convert/Makefile.new 2009-08-25 21:22:54.000000000 +0200
+@@ -53,13 +53,13 @@
+ all: $(TARGETS)
+
+ vidtoppm: vidtoppm.c
+- $(CC) -lXvid -lX11 $(INCLUDE) -o vidtoppm vidtoppm.c
++ $(CC) $(LDFLAGS) $(INCLUDE) $@.o -o $@ -lXvid -lX11
+
+ vidtojpeg: vidtojpeg.c
+- $(CC) -lXvid -lX11 $(INCLUDE) -o vidtojpeg vidtojpeg.c
++ $(CC) $(LDFLAGS) $(INCLUDE) $@.o -o $@ -lXvid -lX11
+
+ vidtoeyuv: vidtoeyuv.c
+- $(CC) -lXvid -lX11 $(INCLUDE) -o vidtoeyuv vidtoeyuv.c
++ $(CC) $(LDFLAGS) $(INCLUDE) $@.o -o $@ -lXvid -lX11
+
+ wc:; wc -l *.[ch] *.pl *.table
+ clean:; rm -f *.o core *~ gmon.out $(TARGETS)
+--- convert/mtv/Makefile 2009-08-25 21:19:42.000000000 +0200
++++ convert/mtv/Makefile.new 2009-08-25 21:24:31.000000000 +0200
+@@ -15,12 +15,12 @@
+ default: movieToVid
+
+ movieToVid: movieToVid.o
+- $(CC) $(CFLAGS) -o movieToVid movieToVid.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.o
+
+ clean:
+ rm -f core lintout makeout tags Makefile.bak *.o \
+ movieToVid
+
+ purify: $(OBJ)
+- $(PURIFY) $(CC) $(OBJ) -o movieToVid.purify
++ $(PURIFY) $(CC) $(LDFLAGS) $(OBJ) -o movieToVid.purify
+
+--- mpeg_encode//Makefile 2009-08-25 21:19:43.000000000 +0200
++++ mpeg_encode//Makefile.new 2009-08-25 21:27:12.000000000 +0200
+@@ -203,7 +203,6 @@
+ ############
+
+ mpeg_encode: $(MP_ALL_OBJS) $(JPEG_LIB)
+- $(PURIFY) $(CC) $(CFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)
+- strip mpeg_encode
++ $(PURIFY) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(MP_ALL_OBJS) $(LIBDIRS) $(LIBS)
+
+ profile: $(MP_ALL_OBJS)
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-build.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-build.patch
new file mode 100644
index 000000000000..70a96c439e9c
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-build.patch
@@ -0,0 +1,56 @@
+--- convert/Makefile
++++ convert/Makefile
+@@ -24,7 +24,7 @@
+ #CC = cc
+
+ # compiler flags
+-CFLAGS = -O -g -Wall -W -Wreturn-type -Wunused -Wmissing-prototypes $(PROFLAG)
++CFLAGS += -Wall -W -Wreturn-type -Wunused -Wmissing-prototypes $(PROFLAG)
+
+ # if you have an ANSI C Compiler, use the following line, otherwise
+ # uncomment the longer .c.o rule, also
+@@ -52,15 +52,6 @@
+
+ all: $(TARGETS)
+
+-ppmtoeyuv: ppmtoeyuv.c
+- $(CC) -o ppmtoeyuv ppmtoeyuv.c
+-
+-jmovie2jpeg: jmovie2jpeg.c
+- $(CC) -o jmovie2jpeg jmovie2jpeg.c
+-
+-mpeg_demux: mpeg_demux.c
+- $(CC) -O -o mpeg_demux mpeg_demux.c
+-
+ vidtoppm: vidtoppm.c
+ $(CC) -lXvid -lX11 $(INCLUDE) -o vidtoppm vidtoppm.c
+
+--- convert/mtv/Makefile
++++ convert/mtv/Makefile
+@@ -4,7 +4,7 @@
+
+ PURIFY = $(PURIFYHOME)/purify
+
+-CFLAGS= -g -I.
++CFLAGS+= -I.
+
+ #CFLAGS= -O -DLITTLE_ENDIEN
+ LFLAGS=
+@@ -15,7 +15,7 @@
+ default: movieToVid
+
+ movieToVid: movieToVid.o
+- cc ${CFLAGS} -o movieToVid movieToVid.o
++ $(CC) $(CFLAGS) -o movieToVid movieToVid.o
+
+ clean:
+ rm -f core lintout makeout tags Makefile.bak *.o \
+--- mpeg_encode/Makefile.orig 2005-09-26 16:01:51.000000000 -0400
++++ mpeg_encode/Makefile 2005-09-26 16:02:11.000000000 -0400
+@@ -97,5 +97,5 @@
+
+ # gcc
+-CFLAGS = $(INCLUDEDIR) $(DEBUGFLAG) -Wall -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG)
++CFLAGS += $(INCLUDEDIR) -Wall -Wmissing-prototypes $(PROFLAG) $(PROTOFLAG)
+
+ # gcc-strict
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-jpeg.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-jpeg.patch
new file mode 100644
index 000000000000..633321879e8d
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-jpeg.patch
@@ -0,0 +1,56 @@
+--- jpeg.c
++++ jpeg.c
+@@ -77,13 +77,10 @@
+
+ /* make it happier.... */
+ #undef DCTSIZE2
+-#include "jpeg/jpeglib.h"
+-
++#include "jpeglib.h"
+
+ #define HEADER_SIZE 607 /*JFIF header size used on output images*/
+
+-
+-
+ /*=======================================================================*
+ * *
+ * JMovie2JPEG *
+@@ -514,8 +511,12 @@
+ #ifdef JPEG4
+ buffer_height = 8; /* could be 2, 4,8 rows high */
+ #else
+- buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_scaled_size;
+-#endif
++ #if JPEG_LIB_VERSION >= 80
++ buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_v_scaled_size;
++ #else
++ buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_scaled_size;
++ #endif
++#endif /* JPEG4 */
+
+ for(cp=0,compptr = cinfo.comp_info;cp<cinfo.num_components;
+ cp++,compptr++) {
+--- Makefile
++++ Makefile
+@@ -36,9 +36,9 @@
+ ##############
+ # JPEG STUFF #
+ ##############
+-JPEG_LIB = jpeg/libjpeg.a
+-JPEG_DIR = -Ijpeg
+-JPEG_LIB_DIR = -Ljpeg
++JPEG_LIB = -ljpeg
++JPEG_DIR =
++JPEG_LIB_DIR =
+ MP_JPEG_OBJS = jpeg.o
+ MP_JPEG_SRCS = jpeg.c
+
+@@ -57,7 +57,7 @@
+ #################
+ # INCLUDE FILES #
+ #################
+-INCLUDEDIR = -Iheaders -I/usr/include $(JPEG_DIR)
++INCLUDEDIR = -Iheaders
+
+ ############################################################################
+ # LIBRARIES # specify library directories; need jpg lib and maybe pbm #
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-powerpc.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-powerpc.patch
new file mode 100644
index 000000000000..3eb2d5f15a60
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-powerpc.patch
@@ -0,0 +1,20 @@
+--- convert/mtv/archdep.h 2010-03-11 04:35:04.596642403 +0000
++++ convert/mtv/archdep.h 2010-03-11 04:34:38.949974604 +0000
+@@ -17,7 +17,7 @@
+ * Note that these macros *do not* work for in-place transformations.
+ */
+
+-#if defined (mc68000) || defined (sparc)
++#if defined (mc68000) || defined (sparc) || defined (__powerpc__) || defined(__POWERPC__)
+ #define DECODE_SHORT(from, to) *((short *)(to)) = *((short *)(from))
+ #define DECODE_LONG(from, to) *((long *)(to)) = *((long *)(from))
+ #define DECODE_FLOAT(from, to) *((float *)(to)) = *((float *)(from))
+@@ -75,7 +75,7 @@
+
+
+ /* Most architectures are symmetrical with respect to conversions. */
+-#if defined (mc68000) || defined (sparc) || defined (i386) || defined(__x86_64)
++#if defined (mc68000) || defined (sparc) || defined (i386) || defined(__x86_64) || defined(__powerpc__) || defined(__POWERPC__)
+ #define ENCODE_SHORT(from, to) DECODE_SHORT((from), (to))
+ #define ENCODE_LONG(from, to) DECODE_LONG((from), (to))
+ #define ENCODE_FLOAT(from, to) DECODE_FLOAT((from), (to))
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg-7.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg-7.patch
new file mode 100644
index 000000000000..3b0ad4792a54
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg-7.patch
@@ -0,0 +1,26 @@
+diff -ur mpeg_encode.orig/jpeg.c mpeg_encode/jpeg.c
+--- mpeg_encode.orig/jpeg.c 2009-08-24 21:33:18.000000000 +0300
++++ mpeg_encode/jpeg.c 2009-08-24 22:23:08.000000000 +0300
+@@ -80,13 +80,9 @@
+ /* make it happier.... */
+ #undef DCTSIZE2
+ #include "jpeglib.h"
+-#include "jpegint.h"
+-
+
+ #define HEADER_SIZE 607 /*JFIF header size used on output images*/
+
+-
+-
+ /*=======================================================================*
+ * *
+ * JMovie2JPEG *
+@@ -517,7 +513,7 @@
+ #ifdef JPEG4
+ buffer_height = 8; /* could be 2, 4,8 rows high */
+ #else
+- buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_scaled_size;
++ buffer_height = cinfo.max_v_samp_factor * cinfo.min_DCT_v_scaled_size;
+ #endif
+
+ for(cp=0,compptr = cinfo.comp_info;cp<cinfo.num_components;
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg.patch
new file mode 100644
index 000000000000..7be3905577c3
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-system-jpeg.patch
@@ -0,0 +1,38 @@
+Use the system jpeg rather than the bundled one
+
+--- mpeg_encode/Makefile
++++ mpeg_encode/Makefile
+@@ -36,9 +36,9 @@
+ ##############
+ # JPEG STUFF #
+ ##############
+-JPEG_LIB = jpeg/libjpeg.a
+-JPEG_DIR = -Ijpeg
+-JPEG_LIB_DIR = -Ljpeg
++JPEG_LIB = -ljpeg
++JPEG_DIR =
++JPEG_LIB_DIR =
+ MP_JPEG_OBJS = jpeg.o
+ MP_JPEG_SRCS = jpeg.c
+
+@@ -57,7 +57,7 @@
+ #################
+ # INCLUDE FILES #
+ #################
+-INCLUDEDIR = -Iheaders -I/usr/include $(JPEG_DIR)
++INCLUDEDIR = -Iheaders
+
+ ############################################################################
+ # LIBRARIES # specify library directories; need jpg lib and maybe pbm #
+--- mpeg_encode/jpeg.c
++++ mpeg_encode/jpeg.c
+@@ -79,7 +79,8 @@
+
+ /* make it happier.... */
+ #undef DCTSIZE2
+-#include "jpeg/jpeglib.h"
++#include "jpeglib.h"
++#include "jpegint.h"
+
+
+ #define HEADER_SIZE 607 /*JFIF header size used on output images*/
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-convert.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-convert.patch
new file mode 100644
index 000000000000..2bab1511bf59
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-convert.patch
@@ -0,0 +1,169 @@
+--- convert/eyuvtojpeg.c
++++ convert/eyuvtojpeg.c
+@@ -25,6 +25,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <unistd.h>
+ #include <malloc.h>
+
+ typedef unsigned char uint8;
+@@ -47,8 +48,9 @@
+ int main(int argc, char **argv)
+ {
+ FILE *fpointer;
+- char command[256];
+- char src[256], dest[256];
++ char command[4096];
++ char src[4096], dest[4096], tempfile[4096];
++ int ret;
+
+ if ((strcmp(argv[1],"-?") == 0) ||
+ (strcmp(argv[1],"-h") == 0) ||
+@@ -99,14 +101,16 @@
+ YUVtoPPM();
+
+ fprintf(stdout, "Writing PPM\n");
+- fpointer = fopen("/tmp/foobar", "w");
++ sprintf(tempfile, "%s.tmp", dest);
++ fpointer = fopen(tempfile, "w");
+ WritePPM(fpointer);
+ fclose(fpointer);
+
+ fprintf(stdout, "Converting to JPEG %s\n", dest);
+- sprintf(command, "cjpeg /tmp/foobar > %s", dest);
+- system(command);
+- return 0;
++ sprintf(command, "cjpeg %s > %s", tempfile, dest);
++ ret = system(command);
++ unlink(tempfile);
++ return ret;
+ }
+
+
+--- convert/vidtoeyuv.c
++++ convert/vidtoeyuv.c
+@@ -125,9 +125,9 @@
+ XImage *ximage;
+ char *tdata;
+ char *obase;
+- char ofname[256];
++ char ofname[4096], tempfile[4096];
+ int height, width;
+- char command[256];
++ char command[4096];
+ int nth;
+
+ if ((argc != 7) && (argc != 8))usage (argv[0]);
+@@ -223,9 +223,11 @@
+
+
+ sprintf(ofname, "%s%d.yuv", obase, i);
+- outFile = fopen("/tmp/foobar", "w");
++ sprintf(tempfile, "%s%d.yuv.tmp", obase, i);
++ outFile = fopen(tempfile, "w");
+ if (!outFile) {
+ perror("Couldn't open output file.");
++ exit(1);
+ }
+
+ for (r=0; r<height; r++) {
+@@ -241,9 +243,10 @@
+
+ free(tdata);
+
+- sprintf(command, "rawtoppm %d %d < /tmp/foobar | ppmtoyuv > %s",
+- width, height, ofname);
++ sprintf(command, "rawtoppm %d %d < %s | ppmtoyuv > %s",
++ width, height, tempfile, ofname);
+ system(command);
++ unlink(tempfile);
+
+ for (j=0; j<nth-1; j++) {
+ if (read (fd, &image, sizeof(image)) != sizeof(image)) {
+--- convert/vidtojpeg.c
++++ convert/vidtojpeg.c
+@@ -123,9 +123,9 @@
+ XImage *ximage;
+ char *tdata;
+ char *obase;
+- char ofname[256];
++ char ofname[4096], tempfile[4096];
+ int height, width;
+- char command[256];
++ char command[4096];
+
+
+ if ((argc != 7) && (argc != 8))usage (argv[0]);
+@@ -221,9 +221,11 @@
+
+
+ sprintf(ofname, "%s.%d.jpeg", obase, i);
+- outFile = fopen("/tmp/foobar", "w");
++ sprintf(tempfile, "%s.%d.jpeg.tmp", obase, i);
++ outFile = fopen(tempfile, "w");
+ if (!outFile) {
+ perror("Couldn't open output file.");
++ exit(1);
+ }
+
+ for (r=0; r<height; r++) {
+@@ -239,9 +241,10 @@
+
+ free(tdata);
+
+- sprintf(command, "rawtoppm %d %d < /tmp/foobar | cjpeg > %s",
+- width, height, ofname);
++ sprintf(command, "rawtoppm %d %d < %s | cjpeg > %s",
++ width, height, tempfile, ofname);
+ system(command);
++ unlink(tempfile);
+ }
+ }
+
+--- convert/vidtoppm.c
++++ convert/vidtoppm.c
+@@ -220,9 +220,11 @@
+
+
+ sprintf(ofname, "%s%d.ppm", obase, i);
+- outFile = fopen("/tmp/foobar", "w");
++ sprintf(tempfile, "%s%d.ppm.tmp", obase, i);
++ outFile = fopen(tempfile, "w");
+ if (!outFile) {
+ perror("Couldn't open output file.");
++ exit(1);
+ }
+
+ for (r=0; r<height; r++) {
+@@ -238,8 +240,9 @@
+
+ free(tdata);
+
+- sprintf(command, "rawtoppm %d %d < /tmp/foobar > %s",
+- width, height, ofname);
++ sprintf(command, "rawtoppm %d %d < %s > %s",
++ width, height, tempfile, ofname);
+ system(command);
++ unlink(tempfile);
+ }
+ }
+--- convert/eyuvtoppm.c
++++ convert/eyuvtoppm.c
+@@ -100,13 +100,9 @@
+ fpointer = fopen(dest, "w");
+ if (fpointer == NULL) {
+ fprintf(stderr, "Problems opening %s!\n", dest);
+- fprintf(stderr, "Trying /tmp/foobar instead\n");
+- strcpy(dest, "/tmp/foobar");
+- fpointer = fopen(dest, "w");
+- if (fpointer == NULL) {
+- fprintf(stderr, "Nope, exiting.\n");
+- exit(1);
+- }}
++ perror("");
++ exit(1);
++ }
+
+ WritePPM(fpointer);
+ fclose(fpointer);
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-mpeg-encode.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-mpeg-encode.patch
new file mode 100644
index 000000000000..1b33bc5dd1c8
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-mpeg-encode.patch
@@ -0,0 +1,87 @@
+--- mpeg_encode/parallel.c
++++ mpeg_encode/parallel.c
+@@ -586,6 +586,8 @@
+ * SIDE EFFECTS: none
+ *
+ *===========================================================================*/
++/* internal hook into the ReadFrame function */
++void _ReadFrame(MpegFrame *frame, char *fileName, FILE *fileHook, char *conversion, boolean addPath);
+ void
+ GetRemoteFrame(frame, frameNumber)
+ MpegFrame *frame;
+@@ -615,8 +617,13 @@
+
+ if ( frameNumber != -1 ) {
+ if ( separateConversion ) {
+- sprintf(fileName, "/tmp/foobar%d", machineNumber);
+- filePtr = fopen(fileName, "wb");
++ int fd;
++ snprintf(fileName, sizeof(fileName), "/tmp/mpeg_encode_foobar%dXXXXXX", machineNumber);
++ fd = mkstemp(fileName);
++ if (fd == -1 || (filePtr = fdopen(fd, "wb")) == NULL) {
++ perror("ERROR: mpeg_encode->GetRemoteFrame");
++ exit(1);
++ }
+
+ /* read in stuff, SafeWrite to file, perform local conversion */
+ do {
+@@ -628,10 +635,12 @@
+ fwrite(smallBuffer, 1, numBytes, filePtr);
+ } while ( numBytes == 1000 );
+ fflush(filePtr);
+- fclose(filePtr);
++ rewind(filePtr);
+
+ /* now do slave conversion */
+- ReadFrame(frame, fileName, slaveConversion, FALSE);
++ _ReadFrame(frame, NULL, filePtr, slaveConversion, FALSE);
++ /* _ReadFrame() will close the file pointer for us */
++ /* fclose(filePtr); */
+ } else {
+ Frame_AllocYCC(frame);
+
+--- mpeg_encode/readframe.c
++++ mpeg_encode/readframe.c
+@@ -227,14 +227,22 @@
+ * SIDE EFFECTS: none
+ *
+ *===========================================================================*/
++void _ReadFrame(MpegFrame *frame, char *fileName, FILE *fileHook, char *conversion, boolean addPath);
++
++void ReadFrame(MpegFrame *frame, char *fileName, char *conversion, boolean addPath)
++{
++ _ReadFrame(frame, fileName, NULL, conversion, addPath);
++}
++
+ void
+-ReadFrame(frame, fileName, conversion, addPath)
++_ReadFrame(frame, fileName, fileHook, conversion, addPath)
+ MpegFrame *frame;
+ char *fileName;
++ FILE *fileHook;
+ char *conversion;
+ boolean addPath;
+ {
+- FILE *ifp;
++ FILE *ifp = fileHook;
+ char command[1024];
+ char fullFileName[1024];
+ MpegFrame tempFrame;
+@@ -274,6 +282,9 @@
+ }
+ #endif
+
++ if (fileHook)
++ goto file_is_already_opened;
++
+ if ( fileType == ANY_FILE_TYPE ) {
+ char *convertPtr, *commandPtr, *charPtr;
+
+@@ -325,6 +336,7 @@
+ exit(1);
+ }
+
++file_is_already_opened:
+ switch(baseFormat) {
+ case YUV_FILE_TYPE:
+
diff --git a/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-tests.patch b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-tests.patch
new file mode 100644
index 000000000000..260f279d2d4b
--- /dev/null
+++ b/media-video/mpeg-tools/files/mpeg-tools-1.5b-tempfile-tests.patch
@@ -0,0 +1,204 @@
+When running tests, don't use /tmp for obvious reasons
+
+Also rewrite the diffscript in sh since csh isnt always available
+
+--- mepg_encode/Makefile
++++ mepg_encode/Makefile
+@@ -187,16 +187,16 @@
+ #########
+
+ test:
+- rm -f /tmp/ts.stat
+- ./mpeg_encode -stat /tmp/ts.stat ./tst/ts.param
+- csh ./tst/diffscript /tmp/ts.stat ./tst/ts.stat /tmp/ts.mpg ./tst/ts.mpg
++ rm -f ./tst/ts.stat.new
++ ./mpeg_encode -stat ./tst/ts.stat.new ./tst/ts.param
++ sh ./tst/diffscript.sh ./tst/ts.stat.new ./tst/ts.stat ./tst/ts.mpg.new ./tst/ts.mpg
+
+ testd:
+- rm -f /tmp/tsd.stat
+- ./mpeg_encode -stat /tmp/tsd.stat ./tst/tsd.param
+- csh ./tst/diffscript /tmp/tsd.stat ./tst/tsd.stat /tmp/tsd.mpg ./tst/tsd.mpg
++ rm -f ./tst/tsd.stat.new
++ ./mpeg_encode -stat ./tst/tsd.stat.new ./tst/tsd.param
++ sh ./tst/diffscript.sh ./tst/tsd.stat.new ./tst/tsd.stat ./tst/tsd.mpg.new ./tst/tsd.mpg
+
+-test_all: test testd
++test_all check: test testd
+
+ ############
+ # BINARIES #
+--- mepg_encode/tst/diffscript.sh
++++ mepg_encode/tst/diffscript.sh
+@@ -0,0 +1,16 @@
++diff $1 $2 > ./foobar
++egrep Blocks ./foobar > ./blockbar
++
++if test ! -s ./blockbar ; then
++ diff $3 $4 > ./foobar.mpg
++ if test -s ./foobar.mpg ; then
++ echo "FAILURE! (different output -- probably endian bug). Please send bug report."
++ exit 1
++ else
++ echo "SUCCESS."
++ exit 0
++ fi
++else
++ echo "FAILURE! (different exection). Please send bug report."
++ exit 1
++fi
+--- mpeg_encode/tst/test_all
++++ mpeg_encode/tst/test_all
+@@ -1,19 +1,19 @@
+-#!/bin/csh -f
++#!/bin/sh
+ cd ..
+-echo "First we encode three mpegs... (note requires 5MB on /tmp)"
+-rm -f /tmp/ts{,2,d}.{mpg,stat}
+-./mpeg_encode -stat /tmp/ts.stat ./tst/ts.param
+-./mpeg_encode -stat /tmp/ts2.stat ./tst/ts2.param
+-./mpeg_encode -stat /tmp/tsd.stat ./tst/tsd.param
++echo "First we encode three mpegs... (note requires 5MB in ./tst)"
++rm -f ./tst/ts{,2,d}.{mpg,stat}.new
++./mpeg_encode -stat ./tst/ts.stat.new ./tst/ts.param
++./mpeg_encode -stat ./tst/ts2.stat.new ./tst/ts2.param
++./mpeg_encode -stat ./tst/tsd.stat.new ./tst/tsd.param
+
+ cd tst
+
+ echo "Test one - tst/ts.param"
+-csh diffscript /tmp/ts.stat ts.stat /tmp/ts.mpg ts.mpg
++sh diffscript.sh ./ts.stat.new ts.stat ./ts.mpg.new ts.mpg
+
+ echo "Test two - tst/ts2.param (different pattern)"
+-csh diffscript /tmp/ts2.stat ts2.stat /tmp/ts2.mpg ts2.mpg
++sh diffscript.sh ./ts2.stat.new ts2.stat ./ts2.mpg.new ts2.mpg
+
+ echo "Test three - tst/tsd.param (uses decoded frames)"
+-csh diffscript /tmp/tsd.stat tsd.stat /tmp/tsd.mpg tsd.mpg
++sh diffscript.sh ./tsd.stat.new tsd.stat ./tsd.mpg.new tsd.mpg
+
+--- mpeg_encode/tst/diffscript
++++ mpeg_encode/tst/diffscript
+@@ -3,23 +3,23 @@
+ #
+ # NOTE: if this script doesn't work, then basically all you need to know
+ # is that the stat files should be the same except for the times.
+-# So the /tmp/blockbar below should be empty if the test succeeded, and non-
++# So the ./blockbar below should be empty if the test succeeded, and non-
+ # empty if it failed. Then the .mpg files are compared.
+ #
+
+-rm -f /tmp/foobar
+-rm -f /tmp/blockbar
++rm -f ./foobar
++rm -f ./blockbar
+
+-diff $1 $2 > /tmp/foobar
++diff $1 $2 > ./foobar
+
+-# /tmp/foobar must exist, since starting times will be different
++# ./foobar must exist, since starting times will be different
+
+-egrep Blocks /tmp/foobar > /tmp/blockbar
++egrep Blocks ./foobar > ./blockbar
+
+-# /tmp/blockbar may or may not exist
+-if ( -z /tmp/blockbar ) then
+- diff $3 $4 > /tmp/foobar.mpg
+- if ( -z /tmp/foobar.mpg ) then
++# ./blockbar may or may not exist
++if ( -z ./blockbar ) then
++ diff $3 $4 > ./foobar.mpg
++ if ( -z ./foobar.mpg ) then
+ echo "SUCCESS."
+ else
+ echo "FAILURE! (different output -- probably endian bug). Please send bug report."
+--- mpeg_encode/tst/ts.param
++++ mpeg_encode/tst/ts.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBBPBBPBBP
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/tsd.param
++++ mpeg_encode/tst/tsd.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBBBPBBBBP
+-OUTPUT /tmp/tsd.mpg
++OUTPUT ./tst/tsd.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/gop.param
++++ mpeg_encode/tst/gop.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBPBIBPBPB
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/short.param
++++ mpeg_encode/tst/short.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBBBPBBB
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/ts2.param
++++ mpeg_encode/tst/ts2.param
+@@ -2,7 +2,7 @@
+
+ PATTERN IBBPBBPBB
+
+-OUTPUT /tmp/ts2.mpg
++OUTPUT ./tst/ts2.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/ts3.param
++++ mpeg_encode/tst/ts3.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBPB
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/ts4.param
++++ mpeg_encode/tst/ts4.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBBBPBBBBP
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+
+--- mpeg_encode/tst/tstl.param
++++ mpeg_encode/tst/tstl.param
+@@ -1,7 +1,7 @@
+ # test suite parameter file
+
+ PATTERN IBBBPBBBBP
+-OUTPUT /tmp/ts.mpg
++OUTPUT ./tst/ts.mpg.new
+
+ YUV_SIZE 352x240
+