summaryrefslogtreecommitdiffstats
path: root/src/itdb_device.c
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2007-05-27 14:58:41 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2007-05-27 14:58:41 +0000
commiteadf524ea1dcc64de5f47e91363dd192425acaf6 (patch)
treea51e1709cfe1715e1a5d6f1a8be4cb51be1bf149 /src/itdb_device.c
parente59cd1d7ea0bedc1b4e39a1cfc2d1076eb17b322 (diff)
downloadlibgpod-eadf524ea1dcc64de5f47e91363dd192425acaf6.tar.gz
libgpod-eadf524ea1dcc64de5f47e91363dd192425acaf6.tar.xz
libgpod-eadf524ea1dcc64de5f47e91363dd192425acaf6.zip
* src/db-artwork-parser.c
src/db-artwork-writer.c src/itdb_device.c src/itdb_itunesdb.c src/itdb_private.h: Fixed segfault when parsing photo databases introduced by the new handling of timestamps (all timestamps exported are host-local time_t). itdb_time_time_t_to_mac() and itdb_time_mac_to_time_t() were renamed to device_*() and take a pointer to an Itdb_Device instead of a pointer to an Itdb_iTunesDB structure as the latter does not exist in case of photo databases. All references to those two functions were changed accordingly and the functions themselves were moved from itdb_itunesdb.c to itdb_device.c. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1439 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb_device.c')
-rw-r--r--src/itdb_device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/itdb_device.c b/src/itdb_device.c
index a79f0a4..9af6030 100644
--- a/src/itdb_device.c
+++ b/src/itdb_device.c
@@ -337,6 +337,22 @@ void itdb_device_set_mountpoint (Itdb_Device *device, const gchar *mp)
}
+G_GNUC_INTERNAL time_t device_time_mac_to_time_t (Itdb_Device *device, guint64 mactime)
+{
+ g_return_val_if_fail (device, 0);
+ if (mactime != 0) return (time_t)(mactime - 2082844800 - device->timezone_shift);
+ else return (time_t)mactime;
+}
+
+G_GNUC_INTERNAL guint64 device_time_time_t_to_mac (Itdb_Device *device, time_t timet)
+{
+ g_return_val_if_fail (device, 0);
+ if (timet != 0)
+ return ((guint64)timet) + 2082844800 + device->timezone_shift;
+ else return 0;
+}
+
+
/**
* itdb_device_read_sysinfo:
* @device: an #Itdb_Device