[totem/gnome-2-28] Fix saving current position for the wrong playlist item
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem/gnome-2-28] Fix saving current position for the wrong playlist item
- Date: Mon, 2 Nov 2009 16:06:51 +0000 (UTC)
commit 3e5705815eee4b108dbf81be10da4d5ca5163df8
Author: Bastien Nocera <hadess hadess net>
Date: Mon Nov 2 15:59:02 2009 +0000
Fix saving current position for the wrong playlist item
When skipping to the next item in the playlist, we
used to use totem_get_current_mrl(), which gets the current
item from the playlist.
Except that the playlist thinks we're already at the next item.
Also use different variables to store the startup and the restore
positions, as we don't want to pause newly added items.
https://bugzilla.gnome.org/show_bug.cgi?id=600425
src/totem-object.c | 16 ++++++++++++----
src/totem-options.c | 2 +-
src/totem-private.h | 3 ++-
src/totem-uri.c | 11 ++++-------
4 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index b7ceb43..da4e79e 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2427,6 +2427,7 @@ on_error_event (BaconVideoWidget *bvw, char *message,
/* Clear the seek if it's there, we only want to try and seek
* the first file, even if it's not there */
totem->seek_to = 0;
+ totem->seek_to_start = 0;
if (playback_stopped)
play_pause_set_label (totem, STATE_STOPPED);
@@ -2477,12 +2478,19 @@ update_seekable (Totem *totem)
gtk_action_set_sensitive (action, seekable);
/* This is for the session restore to seek */
- if (seekable != FALSE && totem->seek_to != 0) {
- bacon_video_widget_seek_time (totem->bvw,
- totem->seek_to, NULL);
- totem_action_pause (totem);
+ if (seekable != FALSE) {
+ if (totem->seek_to != 0) {
+ bacon_video_widget_seek_time (totem->bvw,
+ totem->seek_to, NULL);
+ }
+ if (totem->seek_to_start != 0) {
+ bacon_video_widget_seek_time (totem->bvw,
+ totem->seek_to, NULL);
+ totem_action_pause (totem);
+ }
}
totem->seek_to = 0;
+ totem->seek_to_start = 0;
g_object_notify (G_OBJECT (totem), "seekable");
}
diff --git a/src/totem-options.c b/src/totem-options.c
index b5a5f00..dcc3d98 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -79,7 +79,7 @@ totem_options_process_late (Totem *totem, const TotemCmdLineOptions *options)
totem->index = options->playlistidx;
/* Handle --seek */
- totem->seek_to = options->seek;
+ totem->seek_to_start = options->seek;
}
void
diff --git a/src/totem-private.h b/src/totem-private.h
index 17836fc..22e5c58 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -145,7 +145,7 @@ struct TotemObject {
/* session */
const char *argv0;
- gint64 seek_to;
+ gint64 seek_to_start;
guint index;
gboolean session_restored;
@@ -155,6 +155,7 @@ struct TotemObject {
/* other */
char *mrl;
+ gint64 seek_to;
TotemPlaylist *playlist;
GConfClient *gc;
UniqueApp *app;
diff --git a/src/totem-uri.c b/src/totem-uri.c
index a39358b..c96401b 100644
--- a/src/totem-uri.c
+++ b/src/totem-uri.c
@@ -683,22 +683,19 @@ void
totem_save_position (Totem *totem)
{
gint64 stream_length, position;
- char *mrl, *pos_str;
+ char *pos_str;
GFile *file;
GError *error = NULL;
if (totem->remember_position == FALSE)
return;
+ if (totem->mrl == NULL)
+ return;
stream_length = bacon_video_widget_get_stream_length (totem->bvw);
position = bacon_video_widget_get_current_time (totem->bvw);
- mrl = totem_get_current_mrl (totem);
- if (mrl == NULL)
- return;
-
- file = g_file_new_for_uri (mrl);
- g_free (mrl);
+ file = g_file_new_for_uri (totem->mrl);
/* Don't save if it's:
* - a live stream
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]