]> git.sesse.net Git - vlc/commitdiff
UPnP services discovery: fix remaining bugs
authorMirsal Ennaime <mirsal@mirsal-laptop.(none)>
Thu, 25 Dec 2008 23:52:45 +0000 (00:52 +0100)
committerMirsal Ennaime <mirsal@mirsal-laptop.(none)>
Sun, 4 Jan 2009 10:31:53 +0000 (11:31 +0100)
modules/services_discovery/upnp_intel.cpp

index e6b65bb802f9452cdd2b13aa801bb0b5d67f2e2f..1e1b4f8af997544326d5559abec4669980dec8cd 100644 (file)
@@ -28,7 +28,6 @@
 /*
   \TODO: Debug messages: "__FILE__, __LINE__" ok ???, Wrn/Err ???
   \TODO: Change names to VLC standard ???
-  \TODO: Rewrite this using the new service discovery API (see sap.c, shout.c).
 */
 
 
@@ -288,7 +287,8 @@ static int Open( vlc_object_t *p_this )
     services_discovery_sys_t *p_sys  = ( services_discovery_sys_t * )
             calloc( 1, sizeof( services_discovery_sys_t ) );
 
-    p_sd->p_sys = p_sys;
+    if(!(p_sd->p_sys = p_sys))
+        return VLC_ENOMEM;
 
     services_discovery_SetLocalizedName( p_sd, _("UPnP devices") );
 
@@ -302,7 +302,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->serverList = new MediaServerList( p_sd );
     p_sys->callbackLock = new Lockable();
 
-    res = UpnpRegisterClient( Callback, p_sys, &p_sys->clientHandle );
+    res = UpnpRegisterClient( Callback, p_sd, &p_sys->clientHandle );
     if( res != UPNP_E_SUCCESS )
     {
         msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );
@@ -1068,7 +1068,6 @@ bool MediaServerList::addServer( MediaServer* s )
             s->getFriendlyName() );
 
     services_discovery_t* p_sd = _p_sd;
-    
 
     p_input_item = input_item_New( p_sd, "vlc://nop", s->getFriendlyName() ); 
     s->setInputItem( p_input_item );