1 |
commit: 947cfb57229fa355556103bc50778b54a8bde7a0 |
2 |
Author: Keiji Costantini <strites <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Dec 30 01:14:01 2013 +0000 |
4 |
Commit: Keiji Costantini <strites <AT> gmail <DOT> com> |
5 |
CommitDate: Mon Dec 30 01:14:01 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde-sunset.git;a=commit;h=947cfb57 |
7 |
|
8 |
Amarok fixes to compile with gcc 4.7 and a (somewhat) recent environment |
9 |
|
10 |
--- |
11 |
.../amarok/amarok-1.4.10_p20090130-r6.ebuild | 129 ++++++++ |
12 |
media-sound/amarok/files/amarok-gcc-4.6.patch | 22 ++ |
13 |
.../amarok/files/amarok-helix-constchar.patch | 11 + |
14 |
media-sound/amarok/files/amarok-libmp4v2-3.patch | 330 +++++++++++++++++++++ |
15 |
4 files changed, 492 insertions(+) |
16 |
|
17 |
diff --git a/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild b/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild |
18 |
new file mode 100644 |
19 |
index 0000000..2f17e2a |
20 |
--- /dev/null |
21 |
+++ b/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild |
22 |
@@ -0,0 +1,129 @@ |
23 |
+# Copyright 1999-2010 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Header: /var/cvsroot/gentoo-x86/media-sound/amarok/amarok-1.4.10_p20090130-r3.ebuild,v 1.8 2009/11/07 00:39:24 ssuominen Exp $ |
26 |
+ |
27 |
+EAPI="2" |
28 |
+ |
29 |
+ARTS_REQUIRED="never" |
30 |
+ |
31 |
+LANGS="af ar az be bg bn br ca cs cy da de el en_GB eo es et eu fa fi |
32 |
+fr ga gl he hi hu id is it ja km ko ku lo lt mk ms nb nds ne nl nn pa |
33 |
+pl pt pt_BR ro ru rw se sk sl sq sr sr@Latn ss sv ta tg th tr uk uz |
34 |
+zh_CN zh_TW" |
35 |
+ |
36 |
+LANGS_DOC="da de es et fr it nl pl pt pt_BR ru sv" |
37 |
+ |
38 |
+USE_KEG_PACKAGING="1" |
39 |
+ |
40 |
+inherit kde |
41 |
+ |
42 |
+PKG_SUFFIX="" |
43 |
+ |
44 |
+MY_P="${P/_*/}" |
45 |
+S="${WORKDIR}/${MY_P}" |
46 |
+ |
47 |
+SRC_URI="mirror://kde/stable/amarok/${PV/_*/}/src/${MY_P}.tar.bz2 |
48 |
+ mirror://kde-sunset/amarok-1.4.10-post20090130.diff.tar.bz2" |
49 |
+ |
50 |
+DESCRIPTION="Advanced audio player based on KDE framework." |
51 |
+HOMEPAGE="http://amarok.kde.org/" |
52 |
+ |
53 |
+LICENSE="GPL-2" |
54 |
+ |
55 |
+SLOT="3.5" |
56 |
+KEYWORDS="amd64 ppc ppc64 sparc x86 ~x86-fbsd" |
57 |
+IUSE="mp4 mysql +amazon opengl postgres |
58 |
+visualization ipod ifp real njb mtp musicbrainz daap |
59 |
+python" |
60 |
+# kde: enables compilation of the konqueror sidebar plugin |
61 |
+ |
62 |
+# Blocking previous amarok-1.4:0 versions |
63 |
+RDEPEND=" |
64 |
+ !<media-sound/amarok-1.4.10_p20090130-r2 |
65 |
+ =dev-lang/ruby-1.8* |
66 |
+ >=media-libs/taglib-1.4 |
67 |
+ >=media-libs/xine-lib-1.1.2_pre20060328-r8 |
68 |
+ ifp? ( media-libs/libifp ) |
69 |
+ ipod? ( >=media-libs/libgpod-0.5.2 ) |
70 |
+ mp4? ( media-libs/libmp4v2 ) |
71 |
+ mtp? ( >=media-libs/libmtp-0.3.0 ) |
72 |
+ musicbrainz? ( media-libs/tunepimp ) |
73 |
+ mysql? ( >=virtual/mysql-4.0 ) |
74 |
+ njb? ( >=media-libs/libnjb-2.2.4 ) |
75 |
+ opengl? ( virtual/opengl ) |
76 |
+ postgres? ( dev-db/postgresql-base ) |
77 |
+ real? ( |
78 |
+ media-libs/alsa-lib |
79 |
+ media-video/realplayer |
80 |
+ ) |
81 |
+ visualization? ( |
82 |
+ media-libs/libsdl |
83 |
+ =media-plugins/libvisual-plugins-0.4* |
84 |
+ ) |
85 |
+" |
86 |
+ |
87 |
+DEPEND="${RDEPEND}" |
88 |
+ |
89 |
+RDEPEND="${RDEPEND} |
90 |
+ app-arch/unzip |
91 |
+ daap? ( www-servers/mongrel ) |
92 |
+ python? ( dev-python/PyQt ) |
93 |
+" |
94 |
+ |
95 |
+PATCHES=( |
96 |
+ "${FILESDIR}/${PN}-1.4.9.1-libmtp-0.3.0-API.patch" |
97 |
+ "${FILESDIR}/${PN}-1.4.10-gcc-4.3.patch" |
98 |
+ "${FILESDIR}/${PN}-1.4.10-gcc44.patch" |
99 |
+ "${FILESDIR}/${PN}-gcc-4.6.patch" |
100 |
+ "${FILESDIR}/${PN}-libmp4v2.patch" |
101 |
+ "${FILESDIR}/${PN}-libmp4v2-2.patch" |
102 |
+ "${FILESDIR}/${PN}-libmp4v2-3.patch" |
103 |
+ "${FILESDIR}/${PN}-1.4.10-fix-autoconf-2.64.patch" |
104 |
+ "${FILESDIR}/${PN}-qt3-4.7.patch" |
105 |
+ "${WORKDIR}/${PN}-1.4.10-post20090130.diff" |
106 |
+ "${WORKDIR}/${PN}-1.4.10-desktop-entry.diff" |
107 |
+ "${FILESDIR}/${PN}-1.4.10-xinelib-1.2.patch" |
108 |
+ "${FILESDIR}/${PN}-helix-constchar.patch" |
109 |
+) |
110 |
+ |
111 |
+need-kde 3.5 |
112 |
+ |
113 |
+src_configure() { |
114 |
+ # Extra, unsupported engines are forcefully disabled. |
115 |
+ local myconf=" |
116 |
+ $(use_enable amazon) |
117 |
+ $(use_enable mysql) |
118 |
+ $(use_enable postgres postgresql) |
119 |
+ $(use_with daap) |
120 |
+ $(use_with ifp) |
121 |
+ $(use_with ipod libgpod) |
122 |
+ $(use_with mp4 mp4v2) |
123 |
+ $(use_with mtp libmtp) |
124 |
+ $(use_with musicbrainz) |
125 |
+ $(use_with njb libnjb) |
126 |
+ $(use_with opengl) |
127 |
+ $(use_with real helix) |
128 |
+ $(use_with visualization libvisual) |
129 |
+ --with-xine |
130 |
+ --without-nmm |
131 |
+ " |
132 |
+ |
133 |
+ kde_src_configure |
134 |
+} |
135 |
+ |
136 |
+src_install() { |
137 |
+ kde_src_install |
138 |
+ |
139 |
+ # As much as I respect Ian, I'd rather leave Amarok to use mongrel |
140 |
+ # from Portage, for security and policy reasons. |
141 |
+ rm -rf "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rbconfig \ |
142 |
+ "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/mongrel* \ |
143 |
+ "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rubygems* \ |
144 |
+ "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/gem* \ |
145 |
+ "${D}${KDEDIR}"/$(get_libdir)/ruby_lib |
146 |
+ |
147 |
+ if ! use python; then |
148 |
+ rm -r "${D}${KDEDIR}"/share/apps/amarok/scripts/webcontrol \ |
149 |
+ || die "Unable to remove webcontrol." |
150 |
+ fi |
151 |
+} |
152 |
|
153 |
diff --git a/media-sound/amarok/files/amarok-gcc-4.6.patch b/media-sound/amarok/files/amarok-gcc-4.6.patch |
154 |
new file mode 100644 |
155 |
index 0000000..ccd73c9 |
156 |
--- /dev/null |
157 |
+++ b/media-sound/amarok/files/amarok-gcc-4.6.patch |
158 |
@@ -0,0 +1,22 @@ |
159 |
+diff -urN amarok-1.4.10.orig/amarok/src/actionclasses.cpp amarok-1.4.10/amarok/src/actionclasses.cpp |
160 |
+--- amarok-1.4.10.orig/amarok/src/actionclasses.cpp 2008-08-14 01:21:51.000000000 +0400 |
161 |
++++ amarok-1.4.10/amarok/src/actionclasses.cpp 2011-06-12 16:47:59.273750623 +0400 |
162 |
+@@ -30,6 +30,8 @@ |
163 |
+ #include <ktoolbarbutton.h> |
164 |
+ #include <kurl.h> |
165 |
+ |
166 |
++extern KAboutData aboutData; |
167 |
++ |
168 |
+ namespace Amarok |
169 |
+ { |
170 |
+ bool repeatNone() { return AmarokConfig::repeat() == AmarokConfig::EnumRepeat::Off; } |
171 |
+@@ -171,8 +173,6 @@ |
172 |
+ KPopupMenu* |
173 |
+ Menu::helpMenu( QWidget *parent ) //STATIC |
174 |
+ { |
175 |
+- extern KAboutData aboutData; |
176 |
+- |
177 |
+ if ( s_helpMenu == 0 ) |
178 |
+ s_helpMenu = new KHelpMenu( parent, &aboutData, Amarok::actionCollection() ); |
179 |
+ |
180 |
+ |
181 |
|
182 |
diff --git a/media-sound/amarok/files/amarok-helix-constchar.patch b/media-sound/amarok/files/amarok-helix-constchar.patch |
183 |
new file mode 100644 |
184 |
index 0000000..0118fad |
185 |
--- /dev/null |
186 |
+++ b/media-sound/amarok/files/amarok-helix-constchar.patch |
187 |
@@ -0,0 +1,11 @@ |
188 |
+--- amarok-1.4.10/amarok/src/engine/helix/helix-sp/helix-sp.cpp |
189 |
++++ amarok-1.4.10/amarok/src/engine/helix/helix-sp/helix-sp.cpp |
190 |
+@@ -1509,7 +1509,7 @@ |
191 |
+ delete [] ppctrl[playerIndex]->pszURL; |
192 |
+ |
193 |
+ // see if the file is already in the form of a url |
194 |
+- char *tmp = strstr(file, "://"); |
195 |
++ const char *tmp = strstr(file, "://"); |
196 |
+ if (!tmp) |
197 |
+ { |
198 |
+ char pszURLOrig[MAXPATHLEN]; |
199 |
|
200 |
diff --git a/media-sound/amarok/files/amarok-libmp4v2-3.patch b/media-sound/amarok/files/amarok-libmp4v2-3.patch |
201 |
new file mode 100644 |
202 |
index 0000000..552974a |
203 |
--- /dev/null |
204 |
+++ b/media-sound/amarok/files/amarok-libmp4v2-3.patch |
205 |
@@ -0,0 +1,330 @@ |
206 |
+--- a/amarok/configure.in.in |
207 |
++++ a/amarok/configure.in.in |
208 |
+@@ -995,15 +995,28 @@ if test "$have_mp4v2" != "no"; then |
209 |
+ ac_cppflags_save=$CPPFLAGS |
210 |
+ CPPFLAGS="$CPPFLAGS -I." |
211 |
+ AC_CHECK_HEADERS(systems.h) |
212 |
+- AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4_h=yes], [], |
213 |
++ AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4v2_h=yes], [], |
214 |
+ [#ifdef HAVE_SYSTEMS_H |
215 |
+ # include <systems.h> |
216 |
+ #endif |
217 |
+ ]) |
218 |
++ if test "$have_mp4v2_h" = "yes"; then |
219 |
++ AC_DEFINE(HAVE_MP4V2_H, 1, [have mp4v2 h]) |
220 |
++ else |
221 |
++ AC_CHECK_HEADERS([mp4.h], [have_mp4_h=yes], [], |
222 |
++ [#ifdef HAVE_SYSTEMS_H |
223 |
++ # include <systems.h> |
224 |
++ #endif |
225 |
++ ]) |
226 |
++ if test "$have_mp4_h" = "yes"; then |
227 |
++ AC_DEFINE(HAVE_MP4_H, 1, [have mp4 h]) |
228 |
++ have_mp4v2_h=yes |
229 |
++ fi |
230 |
++ fi |
231 |
+ |
232 |
+ AC_CHECK_LIB( mp4v2, MP4Read, have_mp4v2=yes, have_mp4v2=no ) |
233 |
+ |
234 |
+- if test "$have_mp4v2" = "yes" -a "$have_mp4_h" = "yes"; then |
235 |
++ if test "$have_mp4v2" = "yes" -a "$have_mp4v2_h" = "yes"; then |
236 |
+ AC_DEFINE(HAVE_MP4V2, 1, [have mp4v2]) |
237 |
+ MP4V2_INCLUDES="-I$mp4v2_dir/include" |
238 |
+ MP4V2_LIBS="-L$mp4v2_dir/lib -lmp4v2" |
239 |
+--- a/amarok/src/metadata/mp4/mp4file.cpp |
240 |
++++ a/amarok/src/metadata/mp4/mp4file.cpp |
241 |
+@@ -23,6 +23,8 @@ email : aumuell@××××××.at |
242 |
+ * MA 02110-1301 USA * |
243 |
+ ***************************************************************************/ |
244 |
+ |
245 |
++#include <config.h> |
246 |
++ |
247 |
+ #include "mp4file.h" |
248 |
+ |
249 |
+ #include "mp4tag.h" |
250 |
+@@ -34,7 +36,11 @@ email : aumuell@××××××.at |
251 |
+ #include <stdlib.h> |
252 |
+ #include <sys/types.h> |
253 |
+ |
254 |
++#ifdef HAVE_MP4V2_H |
255 |
++#define USE_ITMF_TAGS |
256 |
++#else |
257 |
+ #define MP4V2_HAS_WRITE_BUG 1 |
258 |
++#endif |
259 |
+ |
260 |
+ namespace TagLib { |
261 |
+ //////////////////////////////////////////////////////////////////////////////// |
262 |
+@@ -102,6 +108,11 @@ bool MP4::File::save() |
263 |
+ return false; |
264 |
+ } |
265 |
+ |
266 |
++#ifdef USE_ITMF_TAGS |
267 |
++ const MP4Tags* filetags = MP4TagsAlloc(); |
268 |
++ MP4TagsFetch(filetags, handle); |
269 |
++#endif |
270 |
++ |
271 |
+ #ifdef MP4V2_HAS_WRITE_BUG |
272 |
+ /* according to gtkpod we have to delete all meta data before modifying it, |
273 |
+ save the stuff we would not touch */ |
274 |
+@@ -117,7 +128,14 @@ bool MP4::File::save() |
275 |
+ #endif |
276 |
+ |
277 |
+ |
278 |
+- |
279 |
++#ifdef USE_ITMF_TAGS |
280 |
++ MP4TagsSetName(filetags, mp4tag->title().isNull() ? "" : mp4tag->title().toCString(true)); |
281 |
++ MP4TagsSetArtist(filetags, mp4tag->artist().isNull() ? "" : mp4tag->artist().toCString(true)); |
282 |
++ MP4TagsSetAlbum(filetags, mp4tag->album().isNull() ? "" : mp4tag->album().toCString(true)); |
283 |
++ MP4TagsSetComments(filetags, mp4tag->comment().isNull() ? "" : mp4tag->comment().toCString(true)); |
284 |
++ MP4TagsSetGenre(filetags, mp4tag->genre().isNull() ? "" : mp4tag->genre().toCString(true)); |
285 |
++ MP4TagsSetComposer(filetags, mp4tag->composer().isNull() ? "" : mp4tag->composer().toCString(true)); |
286 |
++#else |
287 |
+ #define setmeta(val, tag) \ |
288 |
+ if(mp4tag->val().isNull()) { \ |
289 |
+ /*MP4DeleteMetadata##tag(handle);*/ \ |
290 |
+@@ -125,27 +143,65 @@ bool MP4::File::save() |
291 |
+ } else { \ |
292 |
+ MP4SetMetadata##tag(handle, mp4tag->val().toCString(true)); \ |
293 |
+ } |
294 |
+- |
295 |
+ setmeta(title, Name); |
296 |
+ setmeta(artist, Artist); |
297 |
+ setmeta(album, Album); |
298 |
+ setmeta(comment, Comment); |
299 |
+ setmeta(genre, Genre); |
300 |
++ setmeta(composer, Writer); |
301 |
++#endif |
302 |
+ |
303 |
+ char buf[100] = ""; |
304 |
+ if(mp4tag->year()) |
305 |
+ snprintf(buf, sizeof(buf), "%u", mp4tag->year()); |
306 |
++#ifdef USE_ITMF_TAGS |
307 |
++ MP4TagsSetReleaseDate(filetags, buf); |
308 |
++#else |
309 |
+ MP4SetMetadataYear(handle, buf); |
310 |
++#endif |
311 |
+ u_int16_t t1, t2; |
312 |
++ |
313 |
++#ifdef USE_ITMF_TAGS |
314 |
++ MP4TagTrack track = *filetags->track; |
315 |
++ track.index = t1; |
316 |
++ MP4TagsSetTrack(filetags, &track); |
317 |
++#else |
318 |
+ MP4GetMetadataTrack(handle, &t1, &t2); |
319 |
+ MP4SetMetadataTrack(handle, mp4tag->track(), t2); |
320 |
+- if(mp4tag->bpm() != 0) |
321 |
++#endif |
322 |
++ if(mp4tag->bpm() != 0) { |
323 |
++#ifdef USE_ITMF_TAGS |
324 |
++ u_int16_t tempo = mp4tag->bpm(); |
325 |
++ MP4TagsSetTempo(filetags, &tempo); |
326 |
++#else |
327 |
+ MP4SetMetadataTempo(handle, mp4tag->bpm()); |
328 |
++#endif |
329 |
++ } |
330 |
+ if(mp4tag->compilation() != MP4::Tag::Undefined) { |
331 |
++#ifdef USE_ITMF_TAGS |
332 |
++ u_int8_t compilation = mp4tag->compilation(); |
333 |
++ MP4TagsSetCompilation(filetags, &compilation); |
334 |
++#else |
335 |
+ MP4SetMetadataCompilation(handle, mp4tag->compilation()); |
336 |
++#endif |
337 |
+ } |
338 |
+ |
339 |
++#ifdef USE_ITMF_TAGS |
340 |
++ if(mp4tag->cover().size()) { |
341 |
++ MP4TagArtwork art; |
342 |
++ art.size = mp4tag->cover().size(); |
343 |
++ art.data = mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0; |
344 |
++ art.type = MP4_ART_UNDEFINED; // delegate typing to libmp4v2 |
345 |
++ if(filetags->artworkCount > 0) { |
346 |
++ MP4TagsSetArtwork(filetags, 0, &art); |
347 |
++ } |
348 |
++ else { |
349 |
++ MP4TagsAddArtwork(filetags, &art); |
350 |
++ } |
351 |
++ } |
352 |
++#else |
353 |
+ MP4SetMetadataCoverArt(handle, mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0, mp4tag->cover().size()); |
354 |
++#endif |
355 |
+ |
356 |
+ #ifdef MP4V2_HAS_WRITE_BUG |
357 |
+ // set the saved data again |
358 |
+@@ -159,6 +215,10 @@ bool MP4::File::save() |
359 |
+ } |
360 |
+ #endif |
361 |
+ |
362 |
++#ifdef USE_ITMF_TAGS |
363 |
++ MP4TagsStore(filetags, handle); |
364 |
++ MP4TagsFree(filetags); |
365 |
++#endif |
366 |
+ MP4Close(handle); |
367 |
+ |
368 |
+ mp4file = MP4Read(name()); |
369 |
+--- a/amarok/src/metadata/mp4/mp4properties.h |
370 |
++++ a/amarok/src/metadata/mp4/mp4properties.h |
371 |
+@@ -22,13 +22,20 @@ email : andrew.leadbetter@×××××.com |
372 |
+ #ifndef TAGLIB_MP4PROPERTIES_H |
373 |
+ #define TAGLIB_MP4PROPERTIES_H |
374 |
+ |
375 |
++#include <config.h> |
376 |
++ |
377 |
+ #include <audioproperties.h> |
378 |
+ #include <tstring.h> |
379 |
+-#include <mp4v2/mp4v2.h> |
380 |
++#ifdef HAVE_MP4V2_H |
381 |
++# include <mp4v2/mp4v2.h> |
382 |
++#endif |
383 |
++#ifdef HAVE_MP4_H |
384 |
++# include <mp4.h> |
385 |
+ // mp4.h drags in mp4_config.h that defines these |
386 |
+ // get rid of them so they don't conflict with our config.h |
387 |
+ #undef VERSION |
388 |
+ #undef PACKAGE |
389 |
++#endif |
390 |
+ |
391 |
+ namespace TagLib { |
392 |
+ |
393 |
+--- a/amarok/src/metadata/mp4/mp4tag.cpp |
394 |
++++ a/amarok/src/metadata/mp4/mp4tag.cpp |
395 |
+@@ -20,6 +20,8 @@ email : andrew.leadbetter@×××××.com |
396 |
+ * MA 02110-1301 USA * |
397 |
+ ***************************************************************************/ |
398 |
+ |
399 |
++#include <config.h> |
400 |
++ |
401 |
+ #include "mp4tag.h" |
402 |
+ |
403 |
+ #include <tag.h> |
404 |
+@@ -29,6 +31,10 @@ email : andrew.leadbetter@×××××.com |
405 |
+ #include <stdlib.h> |
406 |
+ #include <sys/types.h> |
407 |
+ |
408 |
++#ifdef HAVE_MP4V2_H |
409 |
++#define USE_ITMF_TAGS |
410 |
++#endif |
411 |
++ |
412 |
+ using namespace TagLib; |
413 |
+ |
414 |
+ MP4::Tag::Tag() : TagLib::Tag::Tag() { |
415 |
+@@ -67,21 +73,66 @@ void MP4::Tag::duplicate(const Tag *source, Tag *target, bool overwrite) { |
416 |
+ // Duplicate standard information |
417 |
+ Tag::duplicate(source, target, overwrite); |
418 |
+ |
419 |
+- if (overwrite || target->compilation() == Undefined && source->compilation() != Undefined) |
420 |
++ if ((overwrite || target->compilation() == Undefined) && (source->compilation() != Undefined)) { |
421 |
+ target->setCompilation(source->compilation()); |
422 |
++ } |
423 |
+ |
424 |
+- if (overwrite || target->cover().size() == 0) |
425 |
++ if (overwrite || target->cover().size() == 0) { |
426 |
+ target->setCover(source->cover()); |
427 |
++ } |
428 |
+ } |
429 |
+ |
430 |
+ void MP4::Tag::readTags( MP4FileHandle mp4file ) |
431 |
+ { |
432 |
+ // Now parse tag. |
433 |
++#ifdef USE_ITMF_TAGS |
434 |
++ const MP4Tags* filetags = MP4TagsAlloc(); |
435 |
++ MP4TagsFetch(filetags, mp4file); |
436 |
++ |
437 |
++ if(filetags->name != NULL) { |
438 |
++ m_title = String(filetags->name, String::UTF8); |
439 |
++ } |
440 |
++ if(filetags->artist != NULL) { |
441 |
++ m_artist = String(filetags->artist, String::UTF8); |
442 |
++ } |
443 |
++ if(filetags->comments != NULL) { |
444 |
++ m_comment = String(filetags->comments, String::UTF8); |
445 |
++ } |
446 |
++ if(filetags->releaseDate != NULL) { |
447 |
++ m_year = strtol(filetags->releaseDate, NULL, 0); |
448 |
++ } |
449 |
++ if(filetags->album != NULL) { |
450 |
++ m_album = String(filetags->album, String::UTF8); |
451 |
++ } |
452 |
++ if(filetags->track != NULL) { |
453 |
++ m_track = filetags->track->index; |
454 |
++ } |
455 |
++ if(filetags->disk != NULL) { |
456 |
++ m_disk = filetags->disk->index; |
457 |
++ } |
458 |
++ if(filetags->tempo != NULL) { |
459 |
++ m_bpm = *filetags->tempo; |
460 |
++ } |
461 |
++ if(filetags->compilation != NULL) { |
462 |
++ m_compilation = *filetags->compilation; |
463 |
++ } |
464 |
++ if(filetags->genre != NULL) { |
465 |
++ m_genre = String(filetags->genre, String::UTF8); |
466 |
++ } |
467 |
++ if(filetags->composer != NULL) { |
468 |
++ m_composer = String(filetags->composer, String::UTF8); |
469 |
++ } |
470 |
++ if(filetags->artworkCount > 0) { |
471 |
++ m_image.setData(reinterpret_cast<const char *>( filetags->artwork[0].data ), filetags->artwork[0].size); |
472 |
++ } |
473 |
++ MP4TagsFree(filetags); |
474 |
++#else |
475 |
+ char *value; |
476 |
+ uint8_t boolvalue; |
477 |
+ uint16_t numvalue, numvalue2; |
478 |
+ uint8_t *image; |
479 |
+ uint32_t imageSize; |
480 |
++ |
481 |
+ if (MP4GetMetadataName(mp4file, &value) && value != NULL) { |
482 |
+ m_title = String(value, String::UTF8); |
483 |
+ free(value); |
484 |
+@@ -128,4 +179,5 @@ void MP4::Tag::readTags( MP4FileHandle mp4file ) |
485 |
+ m_image.setData(reinterpret_cast<const char *>( image ), imageSize); |
486 |
+ free(image); |
487 |
+ } |
488 |
++#endif |
489 |
+ } |
490 |
+--- a/amarok/src/metadata/mp4/mp4tag.h |
491 |
++++ a/amarok/src/metadata/mp4/mp4tag.h |
492 |
+@@ -21,9 +21,16 @@ email : andrew.leadbetter@×××××.com |
493 |
+ #ifndef TAGLIB_MP4TAG_H |
494 |
+ #define TAGLIB_MP4TAG_H |
495 |
+ |
496 |
++#include <config.h> |
497 |
++ |
498 |
+ #include <tag.h> |
499 |
+ #include "mp4file.h" |
500 |
+-#include <mp4v2/mp4v2.h> |
501 |
++#ifdef HAVE_MP4V2_H |
502 |
++# include <mp4v2/mp4v2.h> |
503 |
++#endif |
504 |
++#ifdef HAVE_MP4_H |
505 |
++# include <mp4.h> |
506 |
++#endif |
507 |
+ |
508 |
+ namespace TagLib { |
509 |
+ |
510 |
+--- a/amarok/src/metadata/mp4/taglib_mp4filetyperesolver.cpp |
511 |
++++ a/amarok/src/metadata/mp4/taglib_mp4filetyperesolver.cpp |
512 |
+@@ -36,7 +36,11 @@ TagLib::File *MP4FileTypeResolver::createFile(const char *fileName, |
513 |
+ || !strcasecmp(ext, ".mp4") |
514 |
+ || !strcasecmp(ext, ".m4v") || !strcasecmp(ext, ".mp4v"))) |
515 |
+ { |
516 |
+- MP4FileHandle h = MP4Read(fileName, 0); |
517 |
++#if defined(MP4V2_PROJECT_version_hex) && MP4V2_PROJECT_version_hex >= 0x00020000 |
518 |
++ MP4FileHandle h = ::MP4Read(fileName); |
519 |
++#else |
520 |
++ MP4FileHandle h = ::MP4Read(fileName, 0); |
521 |
++#endif |
522 |
+ if(MP4_INVALID_FILE_HANDLE == h) |
523 |
+ { |
524 |
+ return 0; |
525 |
+--- a/config.h.in |
526 |
++++ a/config.h.in |
527 |
+@@ -106,6 +106,9 @@ |
528 |
+ /* have mp4v2 */ |
529 |
+ #undef HAVE_MP4V2 |
530 |
+ |
531 |
++/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */ |
532 |
++#undef HAVE_MP4V2_H |
533 |
++ |
534 |
+ /* Define to 1 if you have the <mp4.h> header file. */ |
535 |
+ #undef HAVE_MP4_H |