]> git.sesse.net Git - vlc/commitdiff
playlist: Fix input item deletion (stupid macros), and don't send to the fetcher...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 21:56:53 +0000 (23:56 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 13 Jul 2008 21:59:00 +0000 (23:59 +0200)
Fix #1704

src/playlist/engine.c

index 2aa85d18dde10f3621fdca36d3f598face43d327..43340c9d8e1853ad47f685574717212e9d425d15 100644 (file)
@@ -582,10 +582,15 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
             {
                 PL_DEBUG("meta ok for %s, need to fetch art", psz_name );
                 vlc_object_lock( p_playlist->p_fetcher );
-                INSERT_ELEM( p_playlist->p_fetcher->pp_waiting,
-                             p_playlist->p_fetcher->i_waiting,
-                             p_playlist->p_fetcher->i_waiting, p_current);
-                vlc_object_signal_unlocked( p_playlist->p_fetcher );
+                if( vlc_object_alive( p_playlist->p_fetcher ) )
+                {
+                    INSERT_ELEM( p_playlist->p_fetcher->pp_waiting,
+                        p_playlist->p_fetcher->i_waiting,
+                        p_playlist->p_fetcher->i_waiting, p_current);
+                    vlc_object_signal_unlocked( p_playlist->p_fetcher );
+                }
+                else
+                    vlc_gc_decref( p_current );
                 vlc_object_unlock( p_playlist->p_fetcher );
             }
             else
@@ -610,9 +615,9 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
         vlc_object_lock( p_obj );
     }
 
-    for( int i = 0; i < p_obj->i_waiting; i++ )
+    while( p_obj->i_waiting > 0 )
     {
-        vlc_gc_decref( p_obj->pp_waiting[i] );
+        vlc_gc_decref( p_obj->pp_waiting[0] );
         REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
     }
 
@@ -698,9 +703,9 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj )
         vlc_object_lock( p_obj );
     }
 
-    for( int i = 0; i < p_obj->i_waiting; i++ )
+    while( p_obj->i_waiting > 0 )
     {
-        vlc_gc_decref( p_obj->pp_waiting[i] );
+        vlc_gc_decref( p_obj->pp_waiting[0] );
         REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
     }