[tracker] tracker-extract: adapt to libcue 2.0.0 API



commit 4ad4d2110a4ab833f0a9244e8306d3717588fc0b
Author: fosero <fosero users noreply github com>
Date:   Sun Feb 28 15:45:15 2016 +0100

    tracker-extract: adapt to libcue 2.0.0 API
    
    Allow optional support for the libcue 2.0.0 API changes: new location of
    libcue.h and a renamed enum.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762512

 configure.ac                            |    9 ++++++---
 src/tracker-extract/tracker-cue-sheet.c |   12 +++++++++++-
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 524b89b..6ded545 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2388,6 +2388,11 @@ if test "x$enable_libcue" != "xno" ; then
 
    if test "x$have_libcue" = "xyes"; then
       AC_DEFINE(HAVE_LIBCUE, [], [Define if we have libcue])
+
+      PKG_CHECK_EXISTS([libcue >= 2.0.0], have_libcue2=yes, have_libcue2=no)
+      if test "x$have_libcue2" = "xyes"; then
+        AC_DEFINE(HAVE_LIBCUE2, [], [Define if we have libcue 2 or up])
+      fi
    fi
 else
    have_libcue="no  (disabled)"
@@ -2399,8 +2404,6 @@ if test "x$enable_libcue" = "xyes"; then
    fi
 fi
 
-AM_CONDITIONAL(HAVE_LIBCUE, test "x$have_libcue" = "xyes")
-
 ####################################################################
 # Check for tracker-extract: AbiWord
 ####################################################################
@@ -2830,7 +2833,7 @@ Metadata Extractors:
        Support XML / HTML:                     $have_libxml2
        Support embedded / sidecar XMP:         $have_exempi
        Support generic media formats:          $have_generic_media_handler ($have_generic_media_handler_app) 
(backend: $gstreamer_backend)
-       Support cue sheet parsing:              $have_libcue
+       Support cue sheet parsing:              $have_libcue (libcue2.0: $have_libcue2)
        Support playlists (w/ Totem):           $have_playlist
        Support ISO image parsing:              $have_libosinfo
        Support AbiWord document parsing:       $have_abiword
diff --git a/src/tracker-extract/tracker-cue-sheet.c b/src/tracker-extract/tracker-cue-sheet.c
index 3c4b524..435f6cb 100644
--- a/src/tracker-extract/tracker-cue-sheet.c
+++ b/src/tracker-extract/tracker-cue-sheet.c
@@ -29,7 +29,9 @@
 #include <gst/gst.h>
 #include <gst/tag/tag.h>
 
-#if defined(HAVE_LIBCUE)
+#if defined(HAVE_LIBCUE2)
+#include <libcue.h>
+#elif defined(HAVE_LIBCUE)
 #include <libcue/libcue.h>
 #endif
 
@@ -94,7 +96,11 @@ add_cdtext_string_tag (Cdtext      *cd_text,
 
 static void
 add_cdtext_comment_date_tag (Rem         *cd_comments,
+#if defined(HAVE_LIBCUE2)
+                             enum RemType index,
+#elif defined(HAVE_LIBCUE)
                              enum Cmt     index,
+#endif
                              GstTagList  *tag_list,
                              const gchar *tag)
 {
@@ -117,7 +123,11 @@ add_cdtext_comment_date_tag (Rem         *cd_comments,
 
 static void
 add_cdtext_comment_double_tag (Rem         *cd_comments,
+#if defined(HAVE_LIBCUE2)
+                               enum RemType index,
+#elif defined(HAVE_LIBCUE)
                                enum Cmt     index,
+#endif
                                GstTagList  *tag_list,
                                const gchar *tag)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]