Commit 7a4fd637 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Hold the lock at creation time to conform to...

playlist: Hold the lock at creation time to conform to playlist_NodesPairCreate requirement to have the pl lock held.
parent ace44bc9
...@@ -107,9 +107,11 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) ...@@ -107,9 +107,11 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
return NULL; return NULL;
/* Create playlist and media library */ /* Create playlist and media library */
PL_LOCK; /* playlist_NodesPairCreate will check for it */
playlist_NodesPairCreate( p_playlist, _( "Playlist" ), playlist_NodesPairCreate( p_playlist, _( "Playlist" ),
&p_playlist->p_local_category, &p_playlist->p_local_category,
&p_playlist->p_local_onelevel, false ); &p_playlist->p_local_onelevel, false );
PL_UNLOCK;
p_playlist->p_local_category->i_flags |= PLAYLIST_RO_FLAG; p_playlist->p_local_category->i_flags |= PLAYLIST_RO_FLAG;
p_playlist->p_local_onelevel->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 ) ...@@ -121,9 +123,11 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
if( config_GetInt( p_playlist, "media-library") ) if( config_GetInt( p_playlist, "media-library") )
{ {
PL_LOCK; /* playlist_NodesPairCreate will check for it */
playlist_NodesPairCreate( p_playlist, _( "Media Library" ), playlist_NodesPairCreate( p_playlist, _( "Media Library" ),
&p_playlist->p_ml_category, &p_playlist->p_ml_category,
&p_playlist->p_ml_onelevel, false ); &p_playlist->p_ml_onelevel, false );
PL_UNLOCK;
if(!p_playlist->p_ml_category || !p_playlist->p_ml_onelevel) if(!p_playlist->p_ml_category || !p_playlist->p_ml_onelevel)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment