[packages/faac] - mpeg4ip patch replaced by mp4v2 patch; use system mp4v2
qboosh
qboosh at pld-linux.org
Sun Dec 9 21:45:10 CET 2012
commit 1151ea8ffcfd9a907e3db0244e5ce3fdc2b8cf56
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Dec 9 21:45:56 2012 +0100
- mpeg4ip patch replaced by mp4v2 patch; use system mp4v2
faac-mp4v2.patch | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++
faac-mpeg4ip.patch | 17 -------
faac.spec | 11 ++---
3 files changed, 131 insertions(+), 24 deletions(-)
---
diff --git a/faac.spec b/faac.spec
index a8cadcb..d01fdbb 100644
--- a/faac.spec
+++ b/faac.spec
@@ -1,6 +1,6 @@
#
# Conditional build:
-%bcond_without mpeg4ip # without MPEG4 support in frontend (which requires mpeg4ip)
+%bcond_without mp4v2 # without MPEG4 support in frontend (which requires mp4v2)
%bcond_without static_libs # don't build static libraries
#
Summary: Freeware Advanced Audio Codec
@@ -13,13 +13,13 @@ Group: Applications/Sound
Source0: http://downloads.sourceforge.net/faac/%{name}-%{version}.tar.gz
# Source0-md5: 80763728d392c7d789cde25614c878f6
Patch0: %{name}-link.patch
-Patch1: %{name}-mpeg4ip.patch
+Patch1: %{name}-mp4v2.patch
URL: http://www.audiocoding.com/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: dos2unix
BuildRequires: libtool
-%{?with_mpeg4ip:BuildRequires: mpeg4ip-devel}
+%{?with_mp4v2:BuildRequires: mp4v2-devel >= 2.0.0}
Requires: %{name}-libs = %{version}-%{release}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -75,9 +75,6 @@ Statyczna biblioteka faac.
%patch0 -p1
%patch1 -p1
-# aclocal can't stand it
-dos2unix configure.in
-
%build
%{__libtoolize}
%{__aclocal}
@@ -85,7 +82,7 @@ dos2unix configure.in
%{__autoheader}
%{__automake}
%configure \
- %{!?with_mpeg4ip:--without-mp4v2} \
+ %{!?with_mp4v2:--without-mp4v2} \
%{!?with_static_libs:--disable-static}
%{__make}
diff --git a/faac-mp4v2.patch b/faac-mp4v2.patch
new file mode 100644
index 0000000..6cbaf05
--- /dev/null
+++ b/faac-mp4v2.patch
@@ -0,0 +1,127 @@
+--- faac-1.28/common/mp4v2/mpeg4ip.h.orig 2009-01-26 23:42:35.000000000 +0100
++++ faac-1.28/common/mp4v2/mpeg4ip.h 2012-12-09 11:31:38.323778806 +0100
+@@ -120,14 +120,6 @@
+ #endif
+ #include <sys/param.h>
+
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-char *strcasestr(const char *haystack, const char *needle);
+-#ifdef __cplusplus
+-}
+-#endif
+-
+ #define OPEN_RDWR O_RDWR
+ #define OPEN_CREAT O_CREAT
+ #define OPEN_RDONLY O_RDONLY
+--- faac-1.28/configure.in.orig 2012-12-09 12:19:05.860386121 +0100
++++ faac-1.28/configure.in 2012-12-09 12:19:43.350385339 +0100
+@@ -30,10 +30,10 @@
+ AM_CONDITIONAL(WITH_MP4V2, false)
+ AM_CONDITIONAL(WITH_EXT_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 <mp4.h>])
++ external_mp4v2=no, [#include <mp4v2/mp4v2.h>])
+
+ if test x$external_mp4v2 = xyes; then
+ AC_MSG_NOTICE([*** Building with external mp4v2 ***])
+--- faac-1.28/frontend/main.c.orig 2009-01-24 02:10:20.000000000 +0100
++++ faac-1.28/frontend/main.c 2012-12-09 21:39:29.046351971 +0100
+@@ -30,7 +30,7 @@
+ #endif
+
+ #ifdef HAVE_LIBMP4V2
+-# include <mp4.h>
++# include <mp4v2/mp4v2.h>
+ #endif
+
+ #define DEFAULT_TNS 0
+@@ -870,7 +870,7 @@
+ if (!faacEncSetConfiguration(hEncoder, myFormat)) {
+ fprintf(stderr, "Unsupported output format!\n");
+ #ifdef HAVE_LIBMP4V2
+- if (container == MP4_CONTAINER) MP4Close(MP4hFile);
++ if (container == MP4_CONTAINER) MP4Close(MP4hFile, 0);
+ #endif
+ return 1;
+ }
+@@ -882,13 +882,8 @@
+ 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? */
+- MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0);
+-#else
+- MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0, 0);
+-#endif
++ MP4hFile = MP4Create(aacFileName, 0);
++
+ if (!MP4_IS_VALID_FILE_HANDLE(MP4hFile)) {
+ fprintf(stderr, "Couldn't create output file %s\n", aacFileName);
+ return 1;
+@@ -901,27 +896,31 @@
+ MP4SetTrackESConfiguration(MP4hFile, MP4track, ASC, ASCLength);
+ free(ASC);
+
++ const MP4Tags *tags = MP4TagsAlloc();
+ /* set metadata */
+ version_string = malloc(strlen(faac_id_string) + 6);
+ strcpy(version_string, "FAAC ");
+ strcpy(version_string + 5, faac_id_string);
+- MP4SetMetadataTool(MP4hFile, version_string);
++ MP4TagsSetEncodingTool(tags, version_string);
+ free(version_string);
+
+- if (artist) MP4SetMetadataArtist(MP4hFile, artist);
+- if (writer) MP4SetMetadataWriter(MP4hFile, writer);
+- if (title) MP4SetMetadataName(MP4hFile, title);
+- if (album) MP4SetMetadataAlbum(MP4hFile, album);
+- if (trackno > 0) MP4SetMetadataTrack(MP4hFile, trackno, ntracks);
+- if (discno > 0) MP4SetMetadataDisk(MP4hFile, discno, ndiscs);
+- if (compilation) MP4SetMetadataCompilation(MP4hFile, compilation);
+- if (year) MP4SetMetadataYear(MP4hFile, year);
+- if (genre) MP4SetMetadataGenre(MP4hFile, genre);
+- if (comment) MP4SetMetadataComment(MP4hFile, comment);
++ if (artist) MP4TagsSetArtist(tags, artist);
++ if (writer) MP4TagsSetComposer(tags, writer);
++ if (title) MP4TagsSetName(tags, title);
++ if (album) MP4TagsSetAlbum(tags, album);
++ if (trackno > 0) { MP4TagTrack track = { .index = trackno, .total = ntracks }; MP4TagsSetTrack(tags, &track); }
++ if (discno > 0) { MP4TagDisk disk = { .index = discno, .total = ndiscs }; MP4TagsSetDisk(tags, &disk); }
++ if (compilation) MP4TagsSetCompilation(tags, &compilation);
++ if (year) MP4TagsSetReleaseDate(tags, year);
++ if (genre) MP4TagsSetGenre(tags, genre);
++ if (comment) MP4TagsSetComments(tags, comment);
+ if (artSize) {
+- MP4SetMetadataCoverArt(MP4hFile, art, artSize);
++ MP4TagArtwork artwork = { .data = art, .size = artSize, .type = MP4_ART_UNDEFINED };
++ MP4TagsAddArtwork(tags, &artwork);
+ free(art);
+ }
++ MP4TagsStore(tags, MP4hFile);
++ MP4TagsFree(tags);
+ }
+ else
+ {
+@@ -1138,11 +1137,11 @@
+ /* clean up */
+ if (container == MP4_CONTAINER)
+ {
+- MP4Close(MP4hFile);
++ MP4Close(MP4hFile, 0);
+ if (optimizeFlag == 1)
+ {
+ fprintf(stderr, "\n\nMP4 format optimization... ");
+- MP4Optimize(aacFileName, NULL, 0);
++ MP4Optimize(aacFileName, NULL);
+ fprintf(stderr, "Done!");
+ }
+ } else
diff --git a/faac-mpeg4ip.patch b/faac-mpeg4ip.patch
deleted file mode 100644
index 14bfc77..0000000
--- a/faac-mpeg4ip.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- faac-1.28/common/mp4v2/mpeg4ip.h.orig 2009-01-26 23:42:35.000000000 +0100
-+++ faac-1.28/common/mp4v2/mpeg4ip.h 2012-12-09 11:31:38.323778806 +0100
-@@ -120,14 +120,6 @@
- #endif
- #include <sys/param.h>
-
--#ifdef __cplusplus
--extern "C" {
--#endif
--char *strcasestr(const char *haystack, const char *needle);
--#ifdef __cplusplus
--}
--#endif
--
- #define OPEN_RDWR O_RDWR
- #define OPEN_CREAT O_CREAT
- #define OPEN_RDONLY O_RDONLY
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/faac.git/commitdiff/1151ea8ffcfd9a907e3db0244e5ce3fdc2b8cf56
More information about the pld-cvs-commit
mailing list