[vlc-commits] taglib: check for the presence of apefile.h

Rémi Duraffort git at videolan.org
Sun May 15 10:08:56 CEST 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun May 15 10:08:09 2011 +0200| [01cf70073fb52a2a8a7e504eaa2fe8a22c9e382b] | committer: Rémi Duraffort

taglib: check for the presence of apefile.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=01cf70073fb52a2a8a7e504eaa2fe8a22c9e382b
---

 configure.ac                   |    1 +
 modules/meta_engine/taglib.cpp |   12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index c1a7b63..7b3430e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1761,6 +1761,7 @@ 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 f8978ad..6d2ca07 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -53,7 +53,9 @@
 #include <id3v2tag.h>
 #include <xiphcomment.h>
 
+#ifdef HAVE_TAGLIB_APEFILE_H
 #include <apefile.h>
+#endif
 #include <flacfile.h>
 #include <mpcfile.h>
 #include <mpegfile.h>
@@ -436,12 +438,15 @@ static int ReadMeta( vlc_object_t* p_this)
 
 
     // Try now to read special tags
+#ifdef HAVE_TAGLIB_APEFILE_H
     if( APE::File* ape = dynamic_cast<APE::File*>(f.file()) )
     {
         if( ape->APETag() )
             ReadMetaFromAPE( ape->APETag(), p_demux_meta, p_meta );
     }
-    else if( FLAC::File* flac = dynamic_cast<FLAC::File*>(f.file()) )
+    else
+#endif
+    if( FLAC::File* flac = dynamic_cast<FLAC::File*>(f.file()) )
     {
         if( flac->ID3v2Tag() )
             ReadMetaFromId3v2( flac->ID3v2Tag(), p_demux_meta, p_meta );
@@ -659,12 +664,15 @@ static int WriteMeta( vlc_object_t *p_this )
 
 
     // Try now to write special tags
+#ifdef HAVE_TAGLIB_APEFILE_H
     if( APE::File* ape = dynamic_cast<APE::File*>(f.file()) )
     {
         if( ape->APETag() )
             WriteMetaToAPE( ape->APETag(), p_item );
     }
-    else if( FLAC::File* flac = dynamic_cast<FLAC::File*>(f.file()) )
+    else
+#endif
+    if( FLAC::File* flac = dynamic_cast<FLAC::File*>(f.file()) )
     {
         if( flac->ID3v2Tag() )
             WriteMetaToId3v2( flac->ID3v2Tag(), p_item );



More information about the vlc-commits mailing list