summaryrefslogtreecommitdiff
path: root/src/totem-playlist.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-03-13 17:27:49 +0100
committerBastien Nocera <hadess@hadess.net>2013-03-13 17:28:54 +0100
commit1194648f45edda5a6a7dd7739efe800f58827eea (patch)
tree4edff42299e805899a27ba629bdb90d3e6c77648 /src/totem-playlist.c
parent30d29c9d4402dde70d1877cf6a91703f3a8c984b (diff)
downloadtotem-1194648f45edda5a6a7dd7739efe800f58827eea.tar.gz
main: Save the starttime in milliseconds
So that we can have sub-second precision when restoring the session.
Diffstat (limited to 'src/totem-playlist.c')
-rw-r--r--src/totem-playlist.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 1c87cf108..babb84c00 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -467,10 +467,10 @@ totem_playlist_save_session_playlist (TotemPlaylist *playlist,
pl_playlist = totem_pl_playlist_new ();
if (starttime > 0) {
- char *starttime_sec;
+ char *starttime_msec;
- starttime_sec = g_strdup_printf ("%" G_GINT64_FORMAT, starttime / 1000);
- g_object_set_data_full (G_OBJECT (pl_playlist), "starttime", starttime_sec, g_free);
+ starttime_msec = g_strdup_printf ("%" G_GINT64_FORMAT, starttime);
+ g_object_set_data_full (G_OBJECT (pl_playlist), "starttime", starttime_msec, g_free);
}
gtk_tree_model_foreach (playlist->priv->model,
@@ -2014,11 +2014,9 @@ parse_starttime (TotemPlaylist *playlist)
if (playlist->priv->starttime == NULL)
return 0;
- ret = totem_pl_parser_parse_duration (playlist->priv->starttime, FALSE);
- if (ret == -1)
- return 0;
+ ret = g_ascii_strtoll (playlist->priv->starttime, NULL, 0);
- return ret * 1000; /* and in msecs */
+ return ret;
}
gboolean