]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/upnp_intel.cpp
Lock the playlist here.
[vlc] / modules / services_discovery / upnp_intel.cpp
index b8db719b8b44874c440e19d64dac1b3f85fc711d..df4807a78b0af07a76076027b294fa818200e173 100644 (file)
@@ -295,9 +295,11 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_playlist = pl_Yield( p_sd );
 
     /* Create our playlist node */
+    vlc_object_lock( p_sys->p_playlist );
     playlist_NodesPairCreate( pl_Get( p_sd ), _("Devices"),
                               &p_sys->p_node_cat, &p_sys->p_node_one,
                               true );
+    vlc_object_unlock( p_sys->p_playlist );
 
     return VLC_SUCCESS;
 }
@@ -347,7 +349,7 @@ static void Run( services_discovery_t* p_sd )
     }
 
     msg_Dbg( p_sd, "UPnP discovery started" );
-    while( !p_sd->b_die )
+    while( vlc_object_alive (p_sd) )
     {
         msleep( 500 );
     }
@@ -881,7 +883,7 @@ void MediaServer::_buildPlaylist( Container* parent )
         /* FIXME: playlist_AddInput() can fail */
         playlist_BothAddInput( p_playlist, p_input, parentNode,
                                PLAYLIST_APPEND, PLAYLIST_END, &i_cat, NULL,
-                               false );
+                               pl_Unlocked );
         vlc_gc_decref( p_input );
         /* TODO: do this better by storing ids */
         playlist_item_t *p_node = playlist_ItemGetById( p_playlist, i_cat, false );