[banshee] Fix to work with libmtp 1.0.x (BGO#594191)
- From: Bertrand Lorentz <blorentz src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] Fix to work with libmtp 1.0.x (BGO#594191)
- Date: Sun, 4 Oct 2009 13:53:35 +0000 (UTC)
commit ff659577f6d6ce243b4f2c837a1eae6178956cfa
Author: Nyall Dawson <nyall zombiepigs net>
Date: Sun Oct 4 15:45:03 2009 +0200
Fix to work with libmtp 1.0.x (BGO#594191)
Libmtp 1.0.0 added a field in its track struct, so we detect it and act
accordingly. Patch by Nyall Dawson with a few changes by me.
Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>
build/m4/banshee/dap-mtp.m4 | 5 +++++
src/Libraries/Mtp/Makefile.am | 6 ++++++
src/Libraries/Mtp/Mtp/Track.cs | 3 +++
3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/build/m4/banshee/dap-mtp.m4 b/build/m4/banshee/dap-mtp.m4
index 9f744d0..c6068f1 100644
--- a/build/m4/banshee/dap-mtp.m4
+++ b/build/m4/banshee/dap-mtp.m4
@@ -17,9 +17,14 @@ AC_DEFUN([BANSHEE_CHECK_DAP_MTP],
if test "x$enable_libmtp" = "xyes"; then
LIBMTP_SO_MAP=$(basename $(find $($PKG_CONFIG --variable=libdir libmtp) -maxdepth 1 -regex '.*libmtp\.so\.[[0-9]][[0-9]]*$' | sort | tail -n 1))
AC_SUBST(LIBMTP_SO_MAP)
+ AC_CHECK_MEMBER([struct LIBMTP_track_struct.modificationdate],
+ LIBMTP_HAS_MODDATE=yes,
+ LIBMTP_HAS_MODDATE=no,
+ [[#include <libmtp.h>]])
fi
AM_CONDITIONAL(ENABLE_MTP, test "x$enable_libmtp" = "xyes")
AM_CONDITIONAL(LIBMTP_EIGHT, test "x$LIBMTP_SO_MAP" = "xlibmtp.so.8")
+ AM_CONDITIONAL(LIBMTP_TRACK_STRUCT_HAS_MODDATE, [test "$LIBMTP_HAS_MODDATE" = "yes"])
])
diff --git a/src/Libraries/Mtp/Makefile.am b/src/Libraries/Mtp/Makefile.am
index 14bf0a9..25462df 100644
--- a/src/Libraries/Mtp/Makefile.am
+++ b/src/Libraries/Mtp/Makefile.am
@@ -4,6 +4,12 @@ LINK = $(REF_MTP)
if LIBMTP_EIGHT
BUILD_DEFINES = "-define:LIBMTP8"
+else
+BUILD_DEFINES = ""
+endif
+
+if LIBMTP_TRACK_STRUCT_HAS_MODDATE
+BUILD_DEFINES += "-define:LIBMTP_TRACK_HAS_MODDATE"
endif
SOURCES = \
diff --git a/src/Libraries/Mtp/Mtp/Track.cs b/src/Libraries/Mtp/Mtp/Track.cs
index fe9c155..2213df9 100644
--- a/src/Libraries/Mtp/Mtp/Track.cs
+++ b/src/Libraries/Mtp/Mtp/Track.cs
@@ -298,6 +298,9 @@ namespace Mtp
public ushort rating; // 0 -> 100
public uint usecount;
public ulong filesize;
+#if LIBMTP_TRACK_HAS_MODDATE
+ public uint modificationdate;
+#endif
public FileType filetype;
public IntPtr next; // Track Null if last
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]