summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Rawlins <monster.romster@gmail.com>2014-01-28 19:45:33 +1100
committerDanny Rawlins <monster.romster@gmail.com>2014-01-28 19:45:33 +1100
commit306ad71cd8683fc27d461c820b505f3b3caafdec (patch)
tree7e3ce52fe07b8463fe4cc958933eccdbdc193081
parent5072695e20eb2bdf59eacb1fcd077f504fe04936 (diff)
downloadcontrib-306ad71cd8683fc27d461c820b505f3b3caafdec.tar.gz
contrib-306ad71cd8683fc27d461c820b505f3b3caafdec.tar.xz
[notify]: faac: removed dependency faad2 new dependency libmp4v2
-rw-r--r--faac/.md5sum2
-rw-r--r--faac/Pkgfile27
-rw-r--r--faac/faac-1.28-inttypes.patch41
-rw-r--r--faac/faac-1.28-libmp4v2_r479_compat.patch138
4 files changed, 197 insertions, 11 deletions
diff --git a/faac/.md5sum b/faac/.md5sum
index 9c55ebba4..075133735 100644
--- a/faac/.md5sum
+++ b/faac/.md5sum
@@ -1,2 +1,4 @@
9d52a17e68fa15ca94e88e1457b94b74 faac-1.28-external-libmp4v2.patch
+02b79fe7400e77f1309f51461bbe0da2 faac-1.28-inttypes.patch
+979ff4f13f36217cb15c92df9fd75f0c faac-1.28-libmp4v2_r479_compat.patch
c5dde68840cefe46532089c9392d1df0 faac-1.28.tar.bz2
diff --git a/faac/Pkgfile b/faac/Pkgfile
index 226732b65..3013e5a89 100644
--- a/faac/Pkgfile
+++ b/faac/Pkgfile
@@ -1,22 +1,27 @@
-# Description: Free MPEG-4 audio codecs from AudioCoding.com
+# Description: MPEG-4 audio codecs.
# URL: http://www.audiocoding.com/
# Maintainer: Danny Rawlins, monster dot romster at gmail dot com
# Packager: Matt Housh, jaeger at morpheus dot net
-# Depends on: faad2
+# Depends on: libmp4v2
name=faac
version=1.28
-release=3
-source=(http://download.sourceforge.net/$name/$name-$version.tar.bz2 \
- $name-$version-external-libmp4v2.patch)
+release=4
+source=(http://download.sourceforge.net/$name/$name-$version.tar.bz2
+ faac-1.28-external-libmp4v2.patch
+ faac-1.28-libmp4v2_r479_compat.patch
+ faac-1.28-inttypes.patch)
-build () {
+build() {
cd $name-$version
+
+ patch -p1 -i $SRC/faac-1.28-external-libmp4v2.patch
+ patch -p0 -i $SRC/faac-1.28-libmp4v2_r479_compat.patch
+ patch -p0 -i $SRC/faac-1.28-inttypes.patch
sed -i -e 's/^AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
- patch -p1 -i $SRC/$name-$version-external-libmp4v2.patch
- chmod +x bootstrap
+
./bootstrap
- ./configure --prefix=/usr
- make CFLAGS="$CFLAGS"
- make prefix=$PKG/usr mandir=$PKG/usr/man install
+ ./configure --prefix=/usr --mandir=/usr/man
+ make
+ make DESTDIR=$PKG install
}
diff --git a/faac/faac-1.28-inttypes.patch b/faac/faac-1.28-inttypes.patch
new file mode 100644
index 000000000..09304fb60
--- /dev/null
+++ b/faac/faac-1.28-inttypes.patch
@@ -0,0 +1,41 @@
+use standard integer types, not linux ones
+
+--- frontend/main.c
++++ frontend/main.c
+@@ -440,13 +440,13 @@
+ MP4TrackId MP4track = 0;
+ unsigned int ntracks = 0, trackno = 0;
+ unsigned int ndiscs = 0, discno = 0;
+- u_int8_t compilation = 0;
++ uint8_t compilation = 0;
+ const char *artist = NULL, *title = NULL, *album = NULL, *year = NULL,
+ *genre = NULL, *comment = NULL, *writer = NULL;
+- u_int8_t *art = NULL;
+- u_int64_t artSize = 0;
+- u_int64_t total_samples = 0;
+- u_int64_t encoded_samples = 0;
++ uint8_t *art = NULL;
++ uint64_t artSize = 0;
++ uint64_t total_samples = 0;
++ uint64_t encoded_samples = 0;
+ unsigned int delay_samples;
+ unsigned int frameSize;
+ #endif
+@@ -647,7 +647,7 @@
+ FILE *artFile = fopen(optarg, "rb");
+
+ if(artFile) {
+- u_int64_t r;
++ uint64_t r;
+
+ fseek(artFile, 0, SEEK_END);
+ artSize = ftell(artFile);
+@@ -1112,7 +1112,7 @@
+ if (bytesWritten > 0)
+ {
+ #ifdef HAVE_LIBMP4V2
+- u_int64_t samples_left = total_samples - encoded_samples + delay_samples;
++ uint64_t samples_left = total_samples - encoded_samples + delay_samples;
+ MP4Duration dur = samples_left > frameSize ? frameSize : samples_left;
+ MP4Duration ofs = encoded_samples > 0 ? 0 : delay_samples;
+
diff --git a/faac/faac-1.28-libmp4v2_r479_compat.patch b/faac/faac-1.28-libmp4v2_r479_compat.patch
new file mode 100644
index 000000000..f4ac8e6d4
--- /dev/null
+++ b/faac/faac-1.28-libmp4v2_r479_compat.patch
@@ -0,0 +1,138 @@
+http://bugs.gentoo.org/397575
+http://sourceforge.net/tracker/?func=detail&aid=3476707&group_id=704&atid=100704
+
+--- configure.in
++++ configure.in
+@@ -33,8 +33,8 @@ AC_CHECK_LIB(gnugetopt, getopt_long)
+ AM_CONDITIONAL(WITH_MP4V2, false)
+ AM_CONDITIONAL(WITH_EXTERNAL_MP4V2, false)
+
+-AC_CHECK_DECLS([MP4Create, MP4MetadataDelete],
+- AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=yes,
++AC_CHECK_DECLS([MP4Create],
++ AC_CHECK_LIB(mp4v2, MP4Create, external_mp4v2=yes,
+ external_mp4v2=no, -lstdc++),
+ external_mp4v2=no, [#include <mp4v2/mp4v2.h>])
+
+@@ -42,6 +42,7 @@ if test x$external_mp4v2 = xyes; then
+ AC_MSG_NOTICE([*** Building with external mp4v2 ***])
+ MY_DEFINE(HAVE_EXTERNAL_LIBMP4V2)
+ AM_CONDITIONAL(WITH_EXTERNAL_MP4V2, true)
++ AC_CHECK_DECLS([MP4TagsAlloc], [], [], [#include <mp4v2/mp4v2.h>])
+ else
+ if test x$WITHMP4V2 = xyes; then
+ AC_MSG_NOTICE([*** Building with internal mp4v2 ***])
+--- frontend/main.c
++++ frontend/main.c
+@@ -873,8 +873,12 @@ int main(int argc, char *argv[])
+ if (!faacEncSetConfiguration(hEncoder, myFormat)) {
+ fprintf(stderr, "Unsupported output format!\n");
+ #ifdef HAVE_LIBMP4V2
++#ifdef MP4_CLOSE_DO_NOT_COMPUTE_BITRATE /* r479 fix */
++ if (container == MP4_CONTAINER) MP4Close(MP4hFile, 0);
++#else
+ if (container == MP4_CONTAINER) MP4Close(MP4hFile);
+ #endif
++#endif
+ return 1;
+ }
+
+@@ -885,12 +889,10 @@ int main(int argc, char *argv[])
+ unsigned long ASCLength = 0;
+ char *version_string;
+
+-#ifdef MP4_CREATE_EXTENSIBLE_FORMAT
+- /* hack to compile against libmp4v2 >= 1.0RC3
+- * why is there no version identifier in mp4.h? */
++#ifdef MP4_DETAILS_ERROR /* r453 fix */
+ MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0);
+ #else
+- MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0, 0);
++ MP4hFile = MP4Create(aacFileName, 0);
+ #endif
+ if (!MP4_IS_VALID_FILE_HANDLE(MP4hFile)) {
+ fprintf(stderr, "Couldn't create output file %s\n", aacFileName);
+@@ -905,12 +907,22 @@ int main(int argc, char *argv[])
+ free(ASC);
+
+ /* set metadata */
++#if HAVE_DECL_MP4TAGSALLOC
++ const MP4Tags* tags;
++ tags = MP4TagsAlloc();
++ MP4TagsFetch( tags, MP4hFile );
++#endif
+ version_string = malloc(strlen(faac_id_string) + 6);
+ strcpy(version_string, "FAAC ");
+ strcpy(version_string + 5, faac_id_string);
++#if !HAVE_DECL_MP4TAGSALLOC
+ MP4SetMetadataTool(MP4hFile, version_string);
++#else
++ MP4TagsSetEncodingTool(tags, version_string);
++#endif
+ free(version_string);
+
++#if !HAVE_DECL_MP4TAGSALLOC
+ if (artist) MP4SetMetadataArtist(MP4hFile, artist);
+ if (writer) MP4SetMetadataWriter(MP4hFile, writer);
+ if (title) MP4SetMetadataName(MP4hFile, title);
+@@ -923,8 +935,40 @@ int main(int argc, char *argv[])
+ if (comment) MP4SetMetadataComment(MP4hFile, comment);
+ if (artSize) {
+ MP4SetMetadataCoverArt(MP4hFile, art, artSize);
++#else
++ if (artist) MP4TagsSetArtist(tags, artist);
++ if (writer) MP4TagsSetComposer(tags, writer);
++ if (title) MP4TagsSetName(tags, title);
++ if (album) MP4TagsSetAlbum(tags, album);
++ if (trackno > 0) {
++ MP4TagTrack tt;
++ tt.index = trackno;
++ tt.total = ntracks;
++ MP4TagsSetTrack(tags, &tt);
++ }
++ if (discno > 0) {
++ MP4TagDisk td;
++ td.index = discno;
++ td.total = ndiscs;
++ MP4TagsSetDisk(tags, &td);
++ }
++ if (compilation) MP4TagsSetCompilation(tags, compilation);
++ if (year) MP4TagsSetReleaseDate(tags, year);
++ if (genre) MP4TagsSetGenre(tags, genre);
++ if (comment) MP4TagsSetComments(tags, comment);
++ if (artSize) {
++ MP4TagArtwork mp4art;
++ mp4art.data = art;
++ mp4art.size = artSize;
++ mp4art.type = MP4_ART_UNDEFINED; // delegate typing to libmp4v2
++ MP4TagsAddArtwork( tags, &mp4art );
++#endif
+ free(art);
+ }
++#if HAVE_DECL_MP4TAGSALLOC
++ MP4TagsStore( tags, MP4hFile );
++ MP4TagsFree( tags );
++#endif
+ }
+ else
+ {
+@@ -1141,11 +1185,19 @@ int main(int argc, char *argv[])
+ /* clean up */
+ if (container == MP4_CONTAINER)
+ {
++#ifdef MP4_CLOSE_DO_NOT_COMPUTE_BITRATE /* r479 fix */
++ MP4Close(MP4hFile, 0);
++#else
+ MP4Close(MP4hFile);
++#endif
+ if (optimizeFlag == 1)
+ {
+ fprintf(stderr, "\n\nMP4 format optimization... ");
++#ifdef MP4_DETAILS_ERROR /* r453 fix */
+ MP4Optimize(aacFileName, NULL, 0);
++#else
++ MP4Optimize(aacFileName, NULL);
++#endif
+ fprintf(stderr, "Done!");
+ }
+ } else

Generated by cgit