[totem/gnome-2-28] Fix behaviour on EOS with only one item in the playlist



commit 8c303aa5243a1aeb5c86d062515d9d6404e1d89f
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 5 14:59:36 2009 +0000

    Fix behaviour on EOS with only one item in the playlist
    
    We want to seek back instead of closing and reopening the
    file when the stream is seekable, and repeat is off.
    
    Also make sure we don't start playing back again in those cases.

 src/totem-object.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index f1e22a4..170af10 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3342,9 +3342,10 @@ on_eos_event (GtkWidget *widget, Totem *totem)
 		return FALSE;
 	}
 
-	if (totem_playlist_has_next_mrl (totem->playlist) == FALSE
-			&& totem_playlist_get_repeat (totem->playlist) == FALSE)
-	{
+	if (totem_playlist_has_next_mrl (totem->playlist) == FALSE &&
+	    totem_playlist_get_repeat (totem->playlist) == FALSE &&
+	    (totem_playlist_get_last (totem->playlist) != 0 ||
+	     totem_is_seekable (totem) == FALSE)) {
 		char *mrl, *subtitle;
 
 		/* Set play button status */
@@ -3357,12 +3358,18 @@ on_eos_event (GtkWidget *widget, Totem *totem)
 		g_free (mrl);
 		g_free (subtitle);
 	} else {
-		if (totem_playlist_get_repeat (totem->playlist)
-				&& totem_playlist_get_last  (totem->playlist) == 0
-				&& totem_is_seekable (totem))
-			totem_action_seek_time (totem, 0);
-		else
+		if (totem_playlist_get_last (totem->playlist) == 0 &&
+		    totem_is_seekable (totem)) {
+			if (totem_playlist_get_repeat (totem->playlist) != FALSE) {
+				totem_action_seek_time (totem, 0);
+				totem_action_play (totem);
+			} else {
+				totem_action_pause (totem);
+				totem_action_seek_time (totem, 0);
+			}
+		} else {
 			totem_action_next (totem);
+		}
 	}
 
 	return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]