1 --- faac-1.28/common/mp4v2/mpeg4ip.h.orig 2009-01-26 23:42:35.000000000 +0100
2 +++ faac-1.28/common/mp4v2/mpeg4ip.h 2012-12-09 11:31:38.323778806 +0100
10 -char *strcasestr(const char *haystack, const char *needle);
15 #define OPEN_RDWR O_RDWR
16 #define OPEN_CREAT O_CREAT
17 #define OPEN_RDONLY O_RDONLY
18 --- faac-1.28/configure.in.orig 2012-12-09 12:19:05.860386121 +0100
19 +++ faac-1.28/configure.in 2012-12-09 12:19:43.350385339 +0100
21 AM_CONDITIONAL(WITH_MP4V2, false)
22 AM_CONDITIONAL(WITH_EXT_MP4V2, false)
24 -AC_CHECK_DECLS([MP4Create, MP4MetadataDelete],
25 - AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=yes,
26 +AC_CHECK_DECLS([MP4Create],
27 + AC_CHECK_LIB(mp4v2, MP4Create, external_mp4v2=yes,
28 external_mp4v2=no, -lstdc++),
29 - external_mp4v2=no, [#include <mp4.h>])
30 + external_mp4v2=no, [#include <mp4v2/mp4v2.h>])
32 if test x$external_mp4v2 = xyes; then
33 AC_MSG_NOTICE([*** Building with external mp4v2 ***])
34 --- faac-1.28/frontend/main.c.orig 2009-01-24 02:10:20.000000000 +0100
35 +++ faac-1.28/frontend/main.c 2012-12-09 21:39:29.046351971 +0100
41 +# include <mp4v2/mp4v2.h>
46 if (!faacEncSetConfiguration(hEncoder, myFormat)) {
47 fprintf(stderr, "Unsupported output format!\n");
49 - if (container == MP4_CONTAINER) MP4Close(MP4hFile);
50 + if (container == MP4_CONTAINER) MP4Close(MP4hFile, 0);
55 unsigned long ASCLength = 0;
58 -#ifdef MP4_CREATE_EXTENSIBLE_FORMAT
59 - /* hack to compile against libmp4v2 >= 1.0RC3
60 - * why is there no version identifier in mp4.h? */
61 - MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0);
63 - MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0, 0);
65 + MP4hFile = MP4Create(aacFileName, 0);
67 if (!MP4_IS_VALID_FILE_HANDLE(MP4hFile)) {
68 fprintf(stderr, "Couldn't create output file %s\n", aacFileName);
71 MP4SetTrackESConfiguration(MP4hFile, MP4track, ASC, ASCLength);
74 + const MP4Tags *tags = MP4TagsAlloc();
76 version_string = malloc(strlen(faac_id_string) + 6);
77 strcpy(version_string, "FAAC ");
78 strcpy(version_string + 5, faac_id_string);
79 - MP4SetMetadataTool(MP4hFile, version_string);
80 + MP4TagsSetEncodingTool(tags, version_string);
83 - if (artist) MP4SetMetadataArtist(MP4hFile, artist);
84 - if (writer) MP4SetMetadataWriter(MP4hFile, writer);
85 - if (title) MP4SetMetadataName(MP4hFile, title);
86 - if (album) MP4SetMetadataAlbum(MP4hFile, album);
87 - if (trackno > 0) MP4SetMetadataTrack(MP4hFile, trackno, ntracks);
88 - if (discno > 0) MP4SetMetadataDisk(MP4hFile, discno, ndiscs);
89 - if (compilation) MP4SetMetadataCompilation(MP4hFile, compilation);
90 - if (year) MP4SetMetadataYear(MP4hFile, year);
91 - if (genre) MP4SetMetadataGenre(MP4hFile, genre);
92 - if (comment) MP4SetMetadataComment(MP4hFile, comment);
93 + if (artist) MP4TagsSetArtist(tags, artist);
94 + if (writer) MP4TagsSetComposer(tags, writer);
95 + if (title) MP4TagsSetName(tags, title);
96 + if (album) MP4TagsSetAlbum(tags, album);
97 + if (trackno > 0) { MP4TagTrack track = { .index = trackno, .total = ntracks }; MP4TagsSetTrack(tags, &track); }
98 + if (discno > 0) { MP4TagDisk disk = { .index = discno, .total = ndiscs }; MP4TagsSetDisk(tags, &disk); }
99 + if (compilation) MP4TagsSetCompilation(tags, &compilation);
100 + if (year) MP4TagsSetReleaseDate(tags, year);
101 + if (genre) MP4TagsSetGenre(tags, genre);
102 + if (comment) MP4TagsSetComments(tags, comment);
104 - MP4SetMetadataCoverArt(MP4hFile, art, artSize);
105 + MP4TagArtwork artwork = { .data = art, .size = artSize, .type = MP4_ART_UNDEFINED };
106 + MP4TagsAddArtwork(tags, &artwork);
109 + MP4TagsStore(tags, MP4hFile);
114 @@ -1138,11 +1137,11 @@
116 if (container == MP4_CONTAINER)
118 - MP4Close(MP4hFile);
119 + MP4Close(MP4hFile, 0);
120 if (optimizeFlag == 1)
122 fprintf(stderr, "\n\nMP4 format optimization... ");
123 - MP4Optimize(aacFileName, NULL, 0);
124 + MP4Optimize(aacFileName, NULL);
125 fprintf(stderr, "Done!");