[vlc-devel] commit: playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requirement to have the pl lock held . (Pierre d'Herbemont )

git version control git at videolan.org
Tue Jul 15 13:19:22 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Jul 15 13:03:51 2008 +0200| [7a4fd6378700e37ce0972ed8a70a31424c96e589]

playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requirement to have the pl lock held.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a4fd6378700e37ce0972ed8a70a31424c96e589
---

 src/playlist/engine.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index ba516c8..6a378fe 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;




More information about the vlc-devel mailing list