]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/vars/playtree.cpp
The playlist have to be locked when calling playlist_ItemGetById (not tested for...
[vlc] / modules / gui / skins2 / vars / playtree.cpp
index 405f0726ce081bd5d37ecbacd4ffe50435bf4747..0179f8c4c226916645fed2ec9d6a724873357946 100644 (file)
@@ -174,14 +174,20 @@ void Playtree::onAppend( playlist_add_t *p_add )
         Iterator item =  findById( p_add->i_item );
         if( item == end() )
         {
+            playlist_Lock( m_pPlaylist );
             playlist_item_t *p_item = playlist_ItemGetById(
-                                        m_pPlaylist, p_add->i_item, pl_Unlocked );
-            if( !p_item ) return;
+                                        m_pPlaylist, p_add->i_item );
+            if( !p_item )
+            {
+                playlist_Unlock( m_pPlaylist );
+                return;
+            }
             UString *pName = new UString( getIntf(),
                                           p_item->p_input->psz_name );
             node->add( p_add->i_item, UStringPtr( pName ),
                       false,false, false, p_item->i_flags & PLAYLIST_RO_FLAG,
                       p_item );
+            playlist_Unlock( m_pPlaylist );
         }
     }
     tree_update descr;