From 7a4fd6378700e37ce0972ed8a70a31424c96e589 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Tue, 15 Jul 2008 13:03:51 +0200 Subject: [PATCH] playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requirement to have the pl lock held. --- src/playlist/engine.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.2