[vlc-devel] [PATCH 7/7] upnp: rename m_opaque to p_server_list
Steve Lhomme
robux4 at videolabs.io
Wed Jun 1 16:38:10 CEST 2016
and also m_callback_lock to m_server_list_lock
---
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 99eb9ef..4a3baea 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -1117,17 +1117,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)
@@ -1193,9 +1193,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;
}
@@ -1205,9 +1205,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)
{
@@ -1224,9 +1224,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;
};
--
2.8.1
More information about the vlc-devel
mailing list