diff --git a/build/m4/banshee/dap-mtp.m4 b/build/m4/banshee/dap-mtp.m4
index c6068f1..0f753ed 100644
--- a/build/m4/banshee/dap-mtp.m4
+++ b/build/m4/banshee/dap-mtp.m4
@@ -26,5 +26,7 @@ AC_DEFUN([BANSHEE_CHECK_DAP_MTP],
 	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"])
+	AC_CHECK_SIZEOF(time_t)
+	AM_CONDITIONAL(LIBMTP_SIZEOF_TIME_T_64, [test "x$SIZEOF_TIME_T" = "x8"])
 ])
 
diff --git a/src/Libraries/Mtp/Makefile.am b/src/Libraries/Mtp/Makefile.am
index 25462df..6a70d13 100644
--- a/src/Libraries/Mtp/Makefile.am
+++ b/src/Libraries/Mtp/Makefile.am
@@ -12,6 +12,10 @@ if LIBMTP_TRACK_STRUCT_HAS_MODDATE
 BUILD_DEFINES += "-define:LIBMTP_TRACK_HAS_MODDATE"
 endif
 
+if LIBMTP_SIZEOF_TIME_T_64
+BUILD_DEFINES += "-define:LIBMTP_SIZEOF_TIME_T_64"
+endif
+
 SOURCES =  \
 	Mtp/AbstractTrackList.cs \
 	Mtp/Album.cs \
diff --git a/src/Libraries/Mtp/Mtp/MtpDevice.cs b/src/Libraries/Mtp/Mtp/MtpDevice.cs
index 22b79ef..66e6386 100644
--- a/src/Libraries/Mtp/Mtp/MtpDevice.cs
+++ b/src/Libraries/Mtp/Mtp/MtpDevice.cs
@@ -484,10 +484,10 @@ namespace Mtp
 	internal struct DeviceEntry
 	{
 		[MarshalAs(UnmanagedType.LPStr)] public string vendor;
-		public short vendor_id;
+		public ushort vendor_id;
 		[MarshalAs(UnmanagedType.LPStr)] public string product;
-		public short product_id;
-		public int device_flags;
+		public ushort product_id;
+		public uint device_flags;
 	}
 
 	[StructLayout(LayoutKind.Sequential)]
diff --git a/src/Libraries/Mtp/Mtp/Track.cs b/src/Libraries/Mtp/Mtp/Track.cs
index 451ad3e..a2f9986 100644
--- a/src/Libraries/Mtp/Mtp/Track.cs
+++ b/src/Libraries/Mtp/Mtp/Track.cs
@@ -299,8 +299,12 @@ namespace Mtp
 		public uint usecount;
 		public ulong filesize;
 #if LIBMTP_TRACK_HAS_MODDATE
+#if LIBMTP_SIZEOF_TIME_T_64
+		public ulong modificationdate;
+#else
 		public uint modificationdate;
 #endif
+#endif
 		public FileType filetype;
 		public IntPtr next; // Track Null if last
 		/*
