[vlc-devel] commit: playlist: playlist_NodeCreate needs the PL_LOCK. (Pierre d' Herbemont )

git version control git at videolan.org
Wed Aug 13 00:54:34 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Aug 12 23:48:54 2008 +0200| [8b783e2c3ccbe07f42df1a13b3b63d27467035d1] | committer: Pierre d'Herbemont 

playlist: playlist_NodeCreate needs the PL_LOCK.

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

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

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index ce92f75..c1f3ed2 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -98,10 +98,12 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
     p_playlist->b_auto_preparse =
                         var_CreateGetBool( p_playlist, "auto-preparse" ) ;
 
+    PL_LOCK; /* playlist_NodeCreate will check for it */
     p_playlist->p_root_category = playlist_NodeCreate( p_playlist, NULL, NULL,
                                     0, NULL );
     p_playlist->p_root_onelevel = playlist_NodeCreate( p_playlist, NULL, NULL,
                                     0, p_playlist->p_root_category->p_input );
+    PL_UNLOCK;
 
     if( !p_playlist->p_root_category || !p_playlist->p_root_onelevel )
         return NULL;
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index d79ec49..c4553cc 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -62,6 +62,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
     input_item_t *p_new_input = NULL;
     playlist_item_t *p_item;
 
+    PL_ASSERT_LOCKED;
     if( !psz_name ) psz_name = _("Undefined");
 
     if( !p_input )




More information about the vlc-devel mailing list