[totem] Fix behaviour on EOS with only one item in the playlist



commit 97b310d853012f52a9a41effb0a77b8c59707d95
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 b669237..45e360c 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3354,9 +3354,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 */
@@ -3369,12 +3370,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]