]> git.sesse.net Git - vlc/commitdiff
playlist: Make sure the currently playing item is released, even if destroyed.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 17:39:27 +0000 (19:39 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 17:39:27 +0000 (19:39 +0200)
(Happens when using a service discovery).

src/playlist/engine.c

index 152b48b18c7042a0dce1f2763278db880ea59932..1a39ce50f9ae7faac2f0e70e5c366bd6fe25da35 100644 (file)
@@ -487,6 +487,14 @@ void playlist_LastLoop( playlist_t *p_playlist )
          playlist_ItemDelete( p_playlist->status.p_node );
          p_playlist->status.p_node = NULL;
     }
+    if( p_playlist->status.p_item &&
+        p_playlist->status.p_item->i_flags & PLAYLIST_REMOVE_FLAG )
+    {
+         PL_DEBUG( "%s was marked for deletion, deleting",
+                         PLI_NAME( p_playlist->status.p_item  ) );
+         playlist_ItemDelete( p_playlist->status.p_item );
+         p_playlist->status.p_item = NULL;
+    }
 
     /* Core should have terminated all SDs before the playlist */
     /* TODO: It fails to do so when not playing anything -- Courmisch */