]>
Commit | Line | Data |
---|---|---|
1151ea8f JB |
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 | |
3 | @@ -120,14 +120,6 @@ | |
4 | #endif | |
5 | #include <sys/param.h> | |
6 | ||
7 | -#ifdef __cplusplus | |
8 | -extern "C" { | |
9 | -#endif | |
10 | -char *strcasestr(const char *haystack, const char *needle); | |
11 | -#ifdef __cplusplus | |
12 | -} | |
13 | -#endif | |
14 | - | |
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 | |
20 | @@ -30,10 +30,10 @@ | |
21 | AM_CONDITIONAL(WITH_MP4V2, false) | |
22 | AM_CONDITIONAL(WITH_EXT_MP4V2, false) | |
23 | ||
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>]) | |
31 | ||
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 | |
36 | @@ -30,7 +30,7 @@ | |
37 | #endif | |
38 | ||
39 | #ifdef HAVE_LIBMP4V2 | |
40 | -# include <mp4.h> | |
41 | +# include <mp4v2/mp4v2.h> | |
42 | #endif | |
43 | ||
44 | #define DEFAULT_TNS 0 | |
45 | @@ -870,7 +870,7 @@ | |
46 | if (!faacEncSetConfiguration(hEncoder, myFormat)) { | |
47 | fprintf(stderr, "Unsupported output format!\n"); | |
48 | #ifdef HAVE_LIBMP4V2 | |
49 | - if (container == MP4_CONTAINER) MP4Close(MP4hFile); | |
50 | + if (container == MP4_CONTAINER) MP4Close(MP4hFile, 0); | |
51 | #endif | |
52 | return 1; | |
53 | } | |
54 | @@ -882,13 +882,8 @@ | |
55 | unsigned long ASCLength = 0; | |
56 | char *version_string; | |
57 | ||
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); | |
62 | -#else | |
63 | - MP4hFile = MP4Create(aacFileName, MP4_DETAILS_ERROR, 0, 0); | |
64 | -#endif | |
65 | + MP4hFile = MP4Create(aacFileName, 0); | |
66 | + | |
67 | if (!MP4_IS_VALID_FILE_HANDLE(MP4hFile)) { | |
68 | fprintf(stderr, "Couldn't create output file %s\n", aacFileName); | |
69 | return 1; | |
70 | @@ -901,27 +896,31 @@ | |
71 | MP4SetTrackESConfiguration(MP4hFile, MP4track, ASC, ASCLength); | |
72 | free(ASC); | |
73 | ||
74 | + const MP4Tags *tags = MP4TagsAlloc(); | |
75 | /* set metadata */ | |
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); | |
81 | free(version_string); | |
82 | ||
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); | |
103 | if (artSize) { | |
104 | - MP4SetMetadataCoverArt(MP4hFile, art, artSize); | |
105 | + MP4TagArtwork artwork = { .data = art, .size = artSize, .type = MP4_ART_UNDEFINED }; | |
106 | + MP4TagsAddArtwork(tags, &artwork); | |
107 | free(art); | |
108 | } | |
109 | + MP4TagsStore(tags, MP4hFile); | |
110 | + MP4TagsFree(tags); | |
111 | } | |
112 | else | |
113 | { | |
114 | @@ -1138,11 +1137,11 @@ | |
115 | /* clean up */ | |
116 | if (container == MP4_CONTAINER) | |
117 | { | |
118 | - MP4Close(MP4hFile); | |
119 | + MP4Close(MP4hFile, 0); | |
120 | if (optimizeFlag == 1) | |
121 | { | |
122 | fprintf(stderr, "\n\nMP4 format optimization... "); | |
123 | - MP4Optimize(aacFileName, NULL, 0); | |
124 | + MP4Optimize(aacFileName, NULL); | |
125 | fprintf(stderr, "Done!"); | |
126 | } | |
127 | } else |