]> git.sesse.net Git - vlc/commitdiff
Fix #2720: when deleting the current playing item we must ask the playlist to
authorRémi Duraffort <ivoire@videolan.org>
Tue, 16 Jun 2009 09:38:23 +0000 (11:38 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 18 Jun 2009 07:40:20 +0000 (09:40 +0200)
reset the current status item.
(cherry picked from commit 6d28f6deddc7596b7d0a6c0236e7ef81f4cacc07)

Signed-off-by: Rémi Duraffort <ivoire@videolan.org>
src/playlist/item.c

index 9210971ccba44b753bc233901ccbbc4eceaa4764..b95fc423beee8fc8ab1c609bf169bfa357905920 100644 (file)
@@ -900,10 +900,16 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
         ARRAY_REMOVE( p_playlist->items, i );
 
     /* Check if it is the current item */
-    if( get_current_status_item( p_playlist ) == p_item && b_stop )
+    if( get_current_status_item( p_playlist ) == p_item )
     {
-        playlist_Control( p_playlist, PLAYLIST_STOP, pl_Locked );
-        msg_Info( p_playlist, "stopping playback" );
+        /* Stop it if we have to */
+        if( b_stop )
+        {
+            playlist_Control( p_playlist, PLAYLIST_STOP, pl_Locked );
+            msg_Info( p_playlist, "stopping playback" );
+        }
+        /* In any case, this item can't be the next one to be played ! */
+        set_current_status_item( p_playlist, NULL );
     }
 
     PL_DEBUG( "deleting item `%s'", p_item->p_input->psz_name );