src/playlist/item.c: Avoid a dead lock.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 08:00:03 +0000 (08:00 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 08:00:03 +0000 (08:00 +0000)
src/playlist/item.c

index 4e14c26..31eaf8b 100644 (file)
@@ -417,7 +417,10 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
         ChangeToNode( p_playlist, p_item_in_category );
 
         if( !p_item_in_one )
         ChangeToNode( p_playlist, p_item_in_category );
 
         if( !p_item_in_one )
+        {
+            if( !b_locked ) PL_UNLOCK;
             return p_item_in_category;
             return p_item_in_category;
+        }
 
         /* Item in one is a root, change it to node */
         if( p_item_in_one->p_parent == p_playlist->p_root_onelevel )
 
         /* Item in one is a root, change it to node */
         if( p_item_in_one->p_parent == p_playlist->p_root_onelevel )