[vlc-commits] taglib: use the taglib version to decide if apefile is available.
Rémi Duraffort
git at videolan.org
Sat Jun 4 10:10:23 CEST 2011
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jun 4 10:09:23 2011 +0200| [b4b357ee09e5a99373b99d5c609bf832f484f748] | committer: Rémi Duraffort
taglib: use the taglib version to decide if apefile is available.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4b357ee09e5a99373b99d5c609bf832f484f748
---
configure.ac | 1 -
modules/meta_engine/taglib.cpp | 15 +++++++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index a96b82c..b6cdb17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1778,7 +1778,6 @@ AS_IF([test "${enable_taglib}" != "no"], [
VLC_ADD_CXXFLAGS([taglib],[$TAGLIB_CFLAGS])
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(taglib/mp4coverart.h)
- AC_CHECK_HEADERS(taglib/apefile.h)
AC_LANG_POP(C++)
], [
AC_MSG_WARN(TagLib library not found)])
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index ce95976..c85efa1 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -45,6 +45,12 @@
// Taglib headers
+#include <taglib.h>
+#define VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c))
+#define TAGLIB_VERSION VERSION_INT(TAGLIB_MAJOR_VERSION, \
+ TAGLIB_MINOR_VERSION, \
+ TAGLIB_PATCH_VERSION)
+
#include <fileref.h>
#include <tag.h>
#include <tbytevector.h>
@@ -53,8 +59,9 @@
#include <id3v2tag.h>
#include <xiphcomment.h>
-#ifdef HAVE_TAGLIB_APEFILE_H
-#include <apefile.h>
+#if TAGLIB_VERSION >= VERSION_INT(1,7,0)
+# define TAGLIB_HAVE_APEFILE_H
+# include <apefile.h>
#endif
#include <flacfile.h>
#include <mpcfile.h>
@@ -438,7 +445,7 @@ static int ReadMeta( vlc_object_t* p_this)
// Try now to read special tags
-#ifdef HAVE_TAGLIB_APEFILE_H
+#ifdef TAGLIB_HAVE_APEFILE_H
if( APE::File* ape = dynamic_cast<APE::File*>(f.file()) )
{
if( ape->APETag() )
@@ -664,7 +671,7 @@ static int WriteMeta( vlc_object_t *p_this )
// Try now to write special tags
-#ifdef HAVE_TAGLIB_APEFILE_H
+#ifdef TAGLIB_HAVE_APEFILE_H
if( APE::File* ape = dynamic_cast<APE::File*>(f.file()) )
{
if( ape->APETag() )
More information about the vlc-commits
mailing list