From: Pierre d'Herbemont Date: Tue, 15 Jul 2008 11:03:51 +0000 (+0200) Subject: playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requi... X-Git-Tag: 0.9.0-test3~449 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7a4fd6378700e37ce0972ed8a70a31424c96e589;p=vlc playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requirement to have the pl lock held. --- diff --git a/src/playlist/engine.c b/src/playlist/engine.c index ba516c86a4..6a378fe7b7 100644 --- a/src/playlist/engine.c +++ b/src/playlist/engine.c @@ -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;