]> git.sesse.net Git - vlc/blobdiff - src/playlist/item.c
playlist: Make sure the preparser and the fetcher releases all their waiting elements.
[vlc] / src / playlist / item.c
index 698ede09cab7cb9e202ba8d1f2e3f383ea327d43..fcde872659f63a136df31725632bb0b176d5b936 100644 (file)
@@ -138,16 +138,16 @@ static void install_input_item_observer( playlist_item_t * p_item )
 static void uninstall_input_item_observer( playlist_item_t * p_item )
 {
     vlc_event_manager_t * p_em = &p_item->p_input->event_manager;
+    vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
+                      input_item_subitem_added, p_item );
     vlc_event_detach( p_em, vlc_InputItemMetaChanged,
                       input_item_changed, p_item );
     vlc_event_detach( p_em, vlc_InputItemDurationChanged,
                       input_item_changed, p_item );
-    vlc_event_detach( p_em, vlc_InputItemSubItemAdded,
-                      input_item_subitem_added, p_item );
     vlc_event_detach( p_em, vlc_InputItemNameChanged,
-                      input_item_subitem_added, p_item );
+                      input_item_changed, p_item );
     vlc_event_detach( p_em, vlc_InputItemInfoChanged,
-                      input_item_subitem_added, p_item );
+                      input_item_changed, p_item );
 }
 
 /*****************************************************************************
@@ -596,7 +596,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
                              p_playlist->p_root_onelevel, false );
         }
         p_playlist->b_reset_currently_playing = true;
-        vlc_cond_signal( &p_playlist->object_wait );
+        vlc_object_signal_unlocked( p_playlist );
         var_SetInteger( p_playlist, "item-change", p_item_in_category->
                                                         p_input->i_id );
         if( !b_locked ) PL_UNLOCK;
@@ -724,7 +724,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
     else
         i_ret = TreeMove( p_playlist, p_item, p_node, i_newpos );
     p_playlist->b_reset_currently_playing = true;
-    vlc_cond_signal( &p_playlist->object_wait );
+    vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     return i_ret;
 }
 
@@ -750,7 +750,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
     val.p_address = p_add;
     p_playlist->b_reset_currently_playing = true;
     if( b_signal )
-        vlc_cond_signal( &p_playlist->object_wait );
+        vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     var_Set( p_playlist, "item-append", val );
     free( p_add );
 }
@@ -808,7 +808,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
         if( p_playlist->p_input )
             input_StopThread( p_playlist->p_input );
         p_playlist->request.i_status = PLAYLIST_RUNNING;
-        vlc_cond_signal( &p_playlist->object_wait );
+        vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
     }
     /* Preparse if PREPARSE or SPREPARSE & not enough meta */
     char *psz_artist = input_item_GetArtist( p_item_cat->p_input );
@@ -890,7 +890,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
             p_playlist->request.b_request = true;
             p_playlist->request.p_item = NULL;
             msg_Info( p_playlist, "stopping playback" );
-            vlc_cond_signal( &p_playlist->object_wait );
+            vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
         }
         b_delay_deletion = true;
     }