summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Tennis <caleb@gentoo.org>2008-12-28 23:05:59 +0000
committerCaleb Tennis <caleb@gentoo.org>2008-12-28 23:05:59 +0000
commit64fbfa93b72ecce41b178a994237c29bbccf1617 (patch)
treee71f1f89a8ac016abca984c128dd66efb58a9f5e /media-video
parentAdded app-portage/layman-1.2.2. (diff)
downloadgentoo-2-64fbfa93b72ecce41b178a994237c29bbccf1617.tar.gz
gentoo-2-64fbfa93b72ecce41b178a994237c29bbccf1617.tar.bz2
gentoo-2-64fbfa93b72ecce41b178a994237c29bbccf1617.zip
Version bump, with patch from 249953
(Portage version: 2.2_rc18/cvs/Linux 2.6.18-xenU-ec2-v1.0 i686)
Diffstat (limited to 'media-video')
-rw-r--r--media-video/qt-faststart/ChangeLog8
-rw-r--r--media-video/qt-faststart/files/qt-faststart-0.2.diff268
-rw-r--r--media-video/qt-faststart/qt-faststart-0.2.ebuild36
3 files changed, 311 insertions, 1 deletions
diff --git a/media-video/qt-faststart/ChangeLog b/media-video/qt-faststart/ChangeLog
index d1c4693846c7..92e3cedf2231 100644
--- a/media-video/qt-faststart/ChangeLog
+++ b/media-video/qt-faststart/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for media-video/qt-faststart
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/qt-faststart/ChangeLog,v 1.2 2008/06/07 12:59:48 caleb Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/qt-faststart/ChangeLog,v 1.3 2008/12/28 23:05:59 caleb Exp $
+
+*qt-faststart-0.2 (28 Dec 2008)
+
+ 28 Dec 2008; Caleb Tennis <caleb@gentoo.org> +files/qt-faststart-0.2.diff,
+ +qt-faststart-0.2.ebuild:
+ version bump, with patch from 249953
07 Jun 2008; Caleb Tennis <caleb@gentoo.org> qt-faststart-0.1.ebuild:
amd64 stable
diff --git a/media-video/qt-faststart/files/qt-faststart-0.2.diff b/media-video/qt-faststart/files/qt-faststart-0.2.diff
new file mode 100644
index 000000000000..985917abdd4a
--- /dev/null
+++ b/media-video/qt-faststart/files/qt-faststart-0.2.diff
@@ -0,0 +1,268 @@
+--- qt-faststart.c 2008-12-05 11:33:16 -0500
++++ qt-faststart.c 2008-12-05 11:45:19 -0500
+@@ -1,9 +1,16 @@
+ /*
+- * qt-faststart.c, v0.1
++ * qt-faststart.c, v0.2
++ *
+ * by Mike Melanson (melanson@pcisys.net)
+ * This file is placed in the public domain. Use the program however you
+ * see fit.
+ *
++ * ChangLog
++ * 20081205 - Andrew Andkjar <andkjar@obtech.net>
++ * qt-faststart.c v0.2 - fixes for infinite loops caused by various malformed input files
++ * Pre 20081205 - Mike Melanson <melanson@pcisys.net>
++ * qt-faststart.c v0.1 - original version
++ *
+ * This utility rearranges a Quicktime file such that the moov atom
+ * is in front of the data, thus facilitating network streaming.
+ *
+@@ -70,32 +77,32 @@
+
+ int main(int argc, char *argv[])
+ {
+- FILE *infile;
+- FILE *outfile;
++ FILE *infile = NULL;
++ FILE *outfile = NULL;
+ unsigned char atom_bytes[ATOM_PREAMBLE_SIZE];
+ uint32_t atom_type = 0;
+ uint64_t atom_size = 0;
+- uint64_t last_offset;
+- unsigned char *moov_atom;
+- unsigned char *ftyp_atom = 0;
+- uint64_t moov_atom_size;
++ uint64_t last_offset = 0;
++ unsigned char *moov_atom = NULL;
++ unsigned char *ftyp_atom = NULL;
++ uint64_t moov_atom_size = 0;
+ uint64_t ftyp_atom_size = 0;
+- uint64_t i, j;
+- uint32_t offset_count;
+- uint64_t current_offset;
++ uint64_t i = 0, j = 0;
++ uint32_t offset_count = 0;
++ uint64_t current_offset = 0;
+ uint64_t start_offset = 0;
+ unsigned char copy_buffer[COPY_BUFFER_SIZE];
+- int bytes_to_copy;
++ int bytes_to_copy = 0;
+
+ if (argc != 3) {
+- printf ("Usage: qt-faststart <infile.mov> <outfile.mov>\n");
++ fprintf(stderr, "Usage: qt-faststart <infile.mov> <outfile.mov>\n");
+ return 0;
+ }
+
+ infile = fopen(argv[1], "rb");
+ if (!infile) {
+ perror(argv[1]);
+- return 1;
++ goto error_out;
+ }
+
+ /* traverse through the atoms in the file to make sure that 'moov' is
+@@ -107,6 +114,11 @@
+ atom_size = (uint32_t)BE_32(&atom_bytes[0]);
+ atom_type = BE_32(&atom_bytes[4]);
+
++ if(atom_size < ATOM_PREAMBLE_SIZE) {
++ fprintf(stderr, "fatal error: bad atom size\n");
++ goto error_out;
++ }
++
+ if ((atom_type != FREE_ATOM) &&
+ (atom_type != JUNK_ATOM) &&
+ (atom_type != MDAT_ATOM) &&
+@@ -116,7 +128,7 @@
+ (atom_type != WIDE_ATOM) &&
+ (atom_type != PICT_ATOM) &&
+ (atom_type != FTYP_ATOM)) {
+- printf ("encountered non-QT top-level atom (is this a Quicktime file?)\n");
++ fprintf(stderr, "encountered non-QT top-level atom (is this a Quicktime file?)\n");
+ break;
+ }
+
+@@ -125,70 +137,82 @@
+ ftyp_atom_size = atom_size;
+ ftyp_atom = malloc(ftyp_atom_size);
+ if (!ftyp_atom) {
+- printf ("could not allocate 0x%llX byte for ftyp atom\n",
+- atom_size);
+- fclose(infile);
+- return 1;
++ fprintf(stderr, "could not allocate 0x%llX byte for ftyp atom\n", atom_size);
++ goto error_out;
+ }
+- fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR);
++
++ if(0 != fseeko(infile, -ATOM_PREAMBLE_SIZE, SEEK_CUR)) {
++ perror(argv[1]);
++ goto error_out;
++ }
++
+ if (fread(ftyp_atom, atom_size, 1, infile) != 1) {
+ perror(argv[1]);
+- free(ftyp_atom);
+- fclose(infile);
+- return 1;
++ goto error_out;
+ }
+ start_offset = ftello(infile);
++ if(start_offset < 0) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ continue;
+ }
+
+ /* 64-bit special case */
+ if (atom_size == 1) {
+ if (fread(atom_bytes, ATOM_PREAMBLE_SIZE, 1, infile) != 1) {
+- break;
++ break;
+ }
+ atom_size = BE_64(&atom_bytes[0]);
+- fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE * 2, SEEK_CUR);
++ if(0 != fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE * 2, SEEK_CUR)) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ } else {
+- fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE, SEEK_CUR);
++ if(0 != fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE, SEEK_CUR)) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ }
+ }
+
+ if (atom_type != MOOV_ATOM) {
+- printf ("last atom in file was not a moov atom\n");
+- fclose(infile);
+- return 0;
++ fprintf(stderr, "last atom in file was not a moov atom\n");
++ goto error_out;
+ }
+
+ /* moov atom was, in fact, the last atom in the chunk; load the whole
+ * moov atom */
+- fseeko(infile, -atom_size, SEEK_END);
++ if(0 != fseeko(infile, -atom_size, SEEK_END)) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ last_offset = ftello(infile);
++ if(last_offset < 0) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ moov_atom_size = atom_size;
+ moov_atom = malloc(moov_atom_size);
+ if (!moov_atom) {
+- printf ("could not allocate 0x%llX byte for moov atom\n",
+- atom_size);
+- fclose(infile);
+- return 1;
++ fprintf(stderr, "could not allocate 0x%llX byte for moov atom\n", atom_size);
++ goto error_out;
+ }
+ if (fread(moov_atom, atom_size, 1, infile) != 1) {
+ perror(argv[1]);
+- free(moov_atom);
+- fclose(infile);
+- return 1;
++ goto error_out;
+ }
+
+ /* this utility does not support compressed atoms yet, so disqualify
+ * files with compressed QT atoms */
+ if (BE_32(&moov_atom[12]) == CMOV_ATOM) {
+- printf ("this utility does not support compressed moov atoms yet\n");
+- free(moov_atom);
+- fclose(infile);
+- return 1;
++ fprintf(stderr, "this utility does not support compressed moov atoms yet\n");
++ goto error_out;
+ }
+
+ /* close; will be re-opened later */
+ fclose(infile);
++ infile = NULL;
+
+ /* crawl through the moov chunk in search of stco or co64 atoms */
+ for (i = 4; i < moov_atom_size - 4; i++) {
+@@ -198,8 +222,7 @@
+ atom_size = BE_32(&moov_atom[i - 4]);
+ if (i + atom_size - 4 > moov_atom_size) {
+ printf (" bad atom size\n");
+- free(moov_atom);
+- return 1;
++ goto error_out;
+ }
+ offset_count = BE_32(&moov_atom[i + 8]);
+ for (j = 0; j < offset_count; j++) {
+@@ -216,8 +239,7 @@
+ atom_size = BE_32(&moov_atom[i - 4]);
+ if (i + atom_size - 4 > moov_atom_size) {
+ printf (" bad atom size\n");
+- free(moov_atom);
+- return 1;
++ goto error_out;
+ }
+ offset_count = BE_32(&moov_atom[i + 8]);
+ for (j = 0; j < offset_count; j++) {
+@@ -240,21 +262,21 @@
+ infile = fopen(argv[1], "rb");
+ if (!infile) {
+ perror(argv[1]);
+- free(moov_atom);
+- return 1;
++ goto error_out;
+ }
+
+ if (start_offset > 0) { /* seek after ftyp atom */
+- fseeko(infile, start_offset, SEEK_SET);
++ if(0 != fseeko(infile, start_offset, SEEK_SET)) {
++ perror(argv[1]);
++ goto error_out;
++ }
+ last_offset -= start_offset;
+ }
+
+ outfile = fopen(argv[2], "wb");
+ if (!outfile) {
+ perror(argv[2]);
+- fclose(outfile);
+- free(moov_atom);
+- return 1;
++ goto error_out;
+ }
+
+ /* dump the same ftyp atom */
+@@ -295,17 +317,16 @@
+
+ fclose(infile);
+ fclose(outfile);
+- free(moov_atom);
+- if (ftyp_atom_size > 0)
+- free(ftyp_atom);
+-
++ free(moov_atom);
++ free(ftyp_atom);
+ return 0;
+
+ error_out:
+- fclose(infile);
+- fclose(outfile);
++ if(infile)
++ fclose(infile);
++ if(outfile)
++ fclose(outfile);
+ free(moov_atom);
+- if (ftyp_atom_size > 0)
+- free(ftyp_atom);
++ free(ftyp_atom);
+ return 1;
+ }
diff --git a/media-video/qt-faststart/qt-faststart-0.2.ebuild b/media-video/qt-faststart/qt-faststart-0.2.ebuild
new file mode 100644
index 000000000000..efcd7e5a51be
--- /dev/null
+++ b/media-video/qt-faststart/qt-faststart-0.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/qt-faststart/qt-faststart-0.2.ebuild,v 1.1 2008/12/28 23:05:59 caleb Exp $
+
+inherit eutils
+
+DESCRIPTION="qt-faststart rearranges quicktime files to help with better network streaming"
+HOMEPAGE="http://svn.mplayerhq.hu/ffmpeg/trunk/tools/qt-faststart.c"
+SRC_URI="mirror://gentoo/ffmpeg-0.4.9-p20070616.tar.bz2"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/ffmpeg"
+
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}.diff" || die "patch failed"
+}
+
+src_compile() {
+ cd "${WORKDIR}/ffmpeg"
+ ./configure
+ make qt-faststart
+}
+
+src_install() {
+ install -D -m 755 -o root -g root "${WORKDIR}/ffmpeg/qt-faststart" "${D}/usr/bin/qt-faststart"
+}