[vlc-commits] upnp: rename m_opaque to p_server_list

Steve Lhomme git at videolan.org
Wed Jun 1 17:42:21 CEST 2016


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Jun  1 16:38:10 2016 +0200| [46653c821d59603e46cda757e51656e23b6a929c] | committer: Jean-Baptiste Kempf

upnp: rename m_opaque to p_server_list

and also m_callback_lock to m_server_list_lock

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/services_discovery/upnp.cpp |   24 ++++++++++++------------
 modules/services_discovery/upnp.hpp |    4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index b0053f1..bb28aa6 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -1222,17 +1222,17 @@ static void Close( vlc_object_t* p_this )
 
 UpnpInstanceWrapper::UpnpInstanceWrapper()
     : m_handle( -1 )
-    , m_opaque( NULL )
+    , p_server_list( NULL )
     , m_refcount( 0 )
 {
-    vlc_mutex_init( &m_callback_lock );
+    vlc_mutex_init( &m_server_list_lock );
 }
 
 UpnpInstanceWrapper::~UpnpInstanceWrapper()
 {
     UpnpUnRegisterClient( m_handle );
     UpnpFinish();
-    vlc_mutex_destroy( &m_callback_lock );
+    vlc_mutex_destroy( &m_server_list_lock );
 }
 
 UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, services_discovery_t *p_sd)
@@ -1298,9 +1298,9 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj, services_disc
     // This assumes a single UPNP SD instance
     if (p_server_list != NULL)
     {
-        vlc_mutex_locker lock( &s_instance->m_callback_lock );
-        assert(!s_instance->m_opaque);
-        s_instance->m_opaque = p_server_list;
+        vlc_mutex_locker lock( &s_instance->m_server_list_lock );
+        assert(!s_instance->p_server_list);
+        s_instance->p_server_list = p_server_list;
     }
     return s_instance;
 }
@@ -1310,9 +1310,9 @@ void UpnpInstanceWrapper::release(bool isSd)
     vlc_mutex_locker lock( &s_lock );
     if ( isSd )
     {
-        vlc_mutex_locker lock( &m_callback_lock );
-        delete m_opaque;
-        m_opaque = NULL;
+        vlc_mutex_locker lock( &m_server_list_lock );
+        delete p_server_list;
+        p_server_list = NULL;
     }
     if (--s_instance->m_refcount == 0)
     {
@@ -1329,9 +1329,9 @@ UpnpClient_Handle UpnpInstanceWrapper::handle() const
 int UpnpInstanceWrapper::Callback(Upnp_EventType event_type, void *p_event, void *p_user_data)
 {
     UpnpInstanceWrapper* self = static_cast<UpnpInstanceWrapper*>( p_user_data );
-    vlc_mutex_locker lock( &self->m_callback_lock );
-    if ( !self->m_opaque )
+    vlc_mutex_locker lock( &self->m_server_list_lock );
+    if ( !self->p_server_list )
         return 0;
-    SD::MediaServerList::Callback( event_type, p_event, self->m_opaque );
+    SD::MediaServerList::Callback( event_type, p_event, self->p_server_list );
     return 0;
 }
diff --git a/modules/services_discovery/upnp.hpp b/modules/services_discovery/upnp.hpp
index 215673b..01bbb23 100644
--- a/modules/services_discovery/upnp.hpp
+++ b/modules/services_discovery/upnp.hpp
@@ -72,8 +72,8 @@ private:
     static UpnpInstanceWrapper* s_instance;
     static vlc_mutex_t s_lock;
     UpnpClient_Handle m_handle;
-    vlc_mutex_t m_callback_lock; // protect m_opaque
-    SD::MediaServerList* m_opaque;
+    vlc_mutex_t m_server_list_lock; // protect p_server_list
+    SD::MediaServerList* p_server_list;
     int m_refcount;
 };
 



More information about the vlc-commits mailing list