summaryrefslogtreecommitdiff
path: root/src/totem-session.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2008-12-10 13:46:27 +0000
committerBastien Nocera <hadess@src.gnome.org>2008-12-10 13:46:27 +0000
commitacdffb78954359665553054ef60027dab4025397 (patch)
treef580f3bcc3a7efab6a6f3873c1724a1e737ebe08 /src/totem-session.c
parent9da967895888de4a706d9dd3bef90f15325f4bec (diff)
downloadtotem-acdffb78954359665553054ef60027dab4025397.tar.gz
Fix totem_playlist_get_current() and totem_playlist_get_last() returning
2008-12-10 Bastien Nocera <hadess@hadess.net> * src/totem-object.c (totem_add_to_playlist_and_play), (totem_get_playlist_length): * src/totem-playlist.c (totem_playlist_get_current), (totem_playlist_get_last): * src/totem-playlist.h: * src/totem-session.c (totem_save_state_cb): * src/totem.h: Fix totem_playlist_get_current() and totem_playlist_get_last() returning negative values (Closes: #563961) svn path=/trunk/; revision=5839
Diffstat (limited to 'src/totem-session.c')
-rw-r--r--src/totem-session.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/totem-session.c b/src/totem-session.c
index b1d266302..9d07249be 100644
--- a/src/totem-session.c
+++ b/src/totem-session.c
@@ -55,6 +55,12 @@ totem_save_state_cb (EggSMClient *client,
char *argv[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
int i = 0;
char *path_id, *current, *seek, *uri;
+ int current_index;
+
+ current_index = totem_playlist_get_current (totem->playlist);
+
+ if (current_index == -1)
+ return;
path_id = totem_session_create_key ();
totem_playlist_save_current_playlist (totem->playlist, path_id);
@@ -67,8 +73,7 @@ totem_save_state_cb (EggSMClient *client,
/* How to clone or restart */
i = 0;
- current = g_strdup_printf ("%d",
- totem_playlist_get_current (totem->playlist));
+ current = g_strdup_printf ("%d", current_index);
seek = g_strdup_printf ("%"G_GINT64_FORMAT,
bacon_video_widget_get_current_time (totem->bvw));
argv[i++] = (char *) totem->argv0;