Commit 1fac4d77 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Fix input item deletion (stupid macros), and don't send to the fetcher if it is dead.

Fix #1704
parent 564cbeae
...@@ -582,10 +582,15 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj ) ...@@ -582,10 +582,15 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
{ {
PL_DEBUG("meta ok for %s, need to fetch art", psz_name ); PL_DEBUG("meta ok for %s, need to fetch art", psz_name );
vlc_object_lock( p_playlist->p_fetcher ); vlc_object_lock( p_playlist->p_fetcher );
INSERT_ELEM( p_playlist->p_fetcher->pp_waiting, if( vlc_object_alive( p_playlist->p_fetcher ) )
p_playlist->p_fetcher->i_waiting, {
p_playlist->p_fetcher->i_waiting, p_current); INSERT_ELEM( p_playlist->p_fetcher->pp_waiting,
vlc_object_signal_unlocked( p_playlist->p_fetcher ); 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 ); vlc_object_unlock( p_playlist->p_fetcher );
} }
else else
...@@ -610,9 +615,9 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj ) ...@@ -610,9 +615,9 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
vlc_object_lock( 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 ); REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
} }
...@@ -698,9 +703,9 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj ) ...@@ -698,9 +703,9 @@ void playlist_FetcherLoop( playlist_fetcher_t *p_obj )
vlc_object_lock( 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 ); REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment