[vlc-devel] commit: Use cookie reference, not (uninitialized) value ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 30 09:10:33 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Aug 30 10:12:29 2008 +0300| [a6b444838032d8efb86e28fc0391c68909d4f2b2] | committer: Rémi Denis-Courmont 

Use cookie reference, not (uninitialized) value

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

 modules/services_discovery/upnp_intel.cpp |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/services_discovery/upnp_intel.cpp b/modules/services_discovery/upnp_intel.cpp
index 721615f..5da4aa6 100644
--- a/modules/services_discovery/upnp_intel.cpp
+++ b/modules/services_discovery/upnp_intel.cpp
@@ -301,7 +301,7 @@ static int Open( vlc_object_t *p_this )
 
     p_sd->p_sys = p_sys;
     p_sys->p_playlist = pl_Yield( p_sd );
-    Cookie cookie = p_sys->cookie;
+    Cookie *cookie = &p_sys->cookie;
 
     /* Create our playlist node */
     vlc_object_lock( p_sys->p_playlist );
@@ -310,9 +310,9 @@ static int Open( vlc_object_t *p_this )
                               true );
     vlc_object_unlock( p_sys->p_playlist );
 
-    p_sys->cookie.serviceDiscovery = p_sd;
-    p_sys->cookie.serverList = new MediaServerList( &cookie );
-    p_sys->cookie.lock = new Lockable();
+    cookie->serviceDiscovery = p_sd;
+    cookie->lock = new Lockable();
+    cookie->serverList = new MediaServerList( cookie );
 
     int res = UpnpInit( 0, 0 );
     if( res != UPNP_E_SUCCESS )
@@ -321,14 +321,15 @@ static int Open( vlc_object_t *p_this )
         goto shutDown;
     }
 
-    res = UpnpRegisterClient( Callback, &cookie, &cookie.clientHandle );
+    res = UpnpRegisterClient( Callback, cookie, &cookie->clientHandle );
     if( res != UPNP_E_SUCCESS )
     {
         msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );
         goto shutDown;
     }
 
-    res = UpnpSearchAsync( cookie.clientHandle, 5, MEDIA_SERVER_DEVICE_TYPE, &cookie );
+    res = UpnpSearchAsync( cookie->clientHandle, 5, MEDIA_SERVER_DEVICE_TYPE,
+                           cookie );
     if( res != UPNP_E_SUCCESS )
     {
         msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );




More information about the vlc-devel mailing list