]> git.sesse.net Git - vlc/commitdiff
playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requi...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 15 Jul 2008 11:03:51 +0000 (13:03 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 15 Jul 2008 11:11:17 +0000 (13:11 +0200)
src/playlist/engine.c

index ba516c86a4198460d7a2326b7062ca7c23f1fa94..6a378fe7b797a304a4e925b03763461b81f5b634 100644 (file)
@@ -107,9 +107,11 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
         return NULL;
 
     /* Create playlist and media library */
+    PL_LOCK; /* playlist_NodesPairCreate will check for it */
     playlist_NodesPairCreate( p_playlist, _( "Playlist" ),
                             &p_playlist->p_local_category,
                             &p_playlist->p_local_onelevel, false );
+    PL_UNLOCK;
 
     p_playlist->p_local_category->i_flags |= PLAYLIST_RO_FLAG;
     p_playlist->p_local_onelevel->i_flags |= PLAYLIST_RO_FLAG;
@@ -121,9 +123,11 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
 
     if( config_GetInt( p_playlist, "media-library") )
     {
+        PL_LOCK; /* playlist_NodesPairCreate will check for it */
         playlist_NodesPairCreate( p_playlist, _( "Media Library" ),
                             &p_playlist->p_ml_category,
                             &p_playlist->p_ml_onelevel, false );
+        PL_UNLOCK;
 
         if(!p_playlist->p_ml_category || !p_playlist->p_ml_onelevel)
             return NULL;