[vlc-devel] commit: upnp_intel: Fix playlist locking. ( Rémi Duraffort )
git version control
git at videolan.org
Mon Jul 28 09:50:38 CEST 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jul 28 09:53:01 2008 +0200| [90a6e08532db5733843224cf0d327f36d0400f73]
upnp_intel: Fix playlist locking.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90a6e08532db5733843224cf0d327f36d0400f73
---
modules/services_discovery/upnp_intel.cpp | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules/services_discovery/upnp_intel.cpp b/modules/services_discovery/upnp_intel.cpp
index df4807a..911d3cf 100644
--- a/modules/services_discovery/upnp_intel.cpp
+++ b/modules/services_discovery/upnp_intel.cpp
@@ -309,10 +309,12 @@ static void Close( vlc_object_t *p_this )
services_discovery_t *p_sd = ( services_discovery_t* )p_this;
services_discovery_sys_t *p_sys = p_sd->p_sys;
+ vlc_object_lock( p_sys->p_playlist );
playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_one, true,
true );
playlist_NodeDelete( pl_Get( p_sd ), p_sys->p_node_cat, true,
true );
+ vlc_object_unlock( p_sys->p_playlist );
pl_Release( p_sd );
free( p_sys );
}
@@ -629,8 +631,10 @@ MediaServer::~MediaServer()
{
if ( _contents )
{
+ vlc_object_lock( _cookie->serviceDiscovery->p_sys->p_playlist );
playlist_NodeDelete( pl_Get( _cookie->serviceDiscovery ) ,
_playlistNode, true, true );
+ vlc_object_unlock( _cookie->serviceDiscovery->p_sys->p_playlist );
}
delete _contents;
@@ -927,9 +931,12 @@ bool MediaServerList::addServer( MediaServer* s )
_list.push_back( s );
char* name = strdup( s->getFriendlyName() );
- playlist_item_t* node = playlist_NodeCreate( pl_Get( _cookie->serviceDiscovery ),
- name,
- _cookie->serviceDiscovery->p_sys->p_node_cat, 0, NULL );
+ vlc_object_lock( _cookie->serviceDiscovery->p_sys->p_playlist );
+ playlist_item_t* node = playlist_NodeCreate(
+ pl_Get( _cookie->serviceDiscovery ), name,
+ _cookie->serviceDiscovery->p_sys->p_node_cat,
+ 0, NULL );
+ vlc_object_unlock( _cookie->serviceDiscovery->p_sys->p_playlist );
free( name );
s->setPlaylistNode( node );
More information about the vlc-devel
mailing list