Commit 46653c82 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf
Browse files

upnp: rename m_opaque to p_server_list



and also m_callback_lock to m_server_list_lock
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 1881166d
......@@ -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;
}
......@@ -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;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment