From 4ad4d2110a4ab833f0a9244e8306d3717588fc0b Mon Sep 17 00:00:00 2001 From: fosero Date: Sun, 28 Feb 2016 15:45:15 +0100 Subject: 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 524b89b3e..6ded545a6 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 3c4b524c6..435f6cb4e 100644 --- a/src/tracker-extract/tracker-cue-sheet.c +++ b/src/tracker-extract/tracker-cue-sheet.c @@ -29,7 +29,9 @@ #include #include -#if defined(HAVE_LIBCUE) +#if defined(HAVE_LIBCUE2) +#include +#elif defined(HAVE_LIBCUE) #include #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) { -- cgit v1.2.1