]> git.sesse.net Git - vlc/commitdiff
plqylist: Delete current playing item, if qpplicable, inside the PL_LOCK, and at...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 14 Jul 2008 23:25:39 +0000 (01:25 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 14 Jul 2008 23:26:04 +0000 (01:26 +0200)
src/playlist/engine.c

index 43340c9d8e1853ad47f685574717212e9d425d15..5a6a90e7fc381e8806d246ac0c28738c0e1db450 100644 (file)
@@ -482,6 +482,18 @@ void playlist_LastLoop( playlist_t *p_playlist )
         sout_DeleteInstance( p_sout );
 #endif
 
+    /* Core should have terminated all SDs before the playlist */
+    /* TODO: It fails to do so when not playing anything -- Courmisch */
+    playlist_ServicesDiscoveryKillAll( p_playlist );
+    playlist_MLDump( p_playlist );
+
+    vlc_object_kill( p_playlist->p_preparse );
+    vlc_thread_join( p_playlist->p_preparse );
+    vlc_object_kill( p_playlist->p_fetcher );
+    vlc_thread_join( p_playlist->p_fetcher );
+
+    PL_LOCK;
+
     if( p_playlist->status.p_node &&
         p_playlist->status.p_node->i_flags & PLAYLIST_REMOVE_FLAG )
     {
@@ -499,17 +511,6 @@ void playlist_LastLoop( playlist_t *p_playlist )
          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 */
-    playlist_ServicesDiscoveryKillAll( p_playlist );
-    playlist_MLDump( p_playlist );
-
-    vlc_object_kill( p_playlist->p_preparse );
-    vlc_thread_join( p_playlist->p_preparse );
-    vlc_object_kill( p_playlist->p_fetcher );
-    vlc_thread_join( p_playlist->p_fetcher );
-
-    PL_LOCK;
     FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items )
         free( p_del->pp_children );
         vlc_gc_decref( p_del->p_input );