Commit 40f43d32 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use libvlc_priv_t for httpd

parent e0a120ef
...@@ -178,11 +178,11 @@ libvlc_int_t * libvlc_InternalCreate( void ) ...@@ -178,11 +178,11 @@ libvlc_int_t * libvlc_InternalCreate( void )
if( p_libvlc == NULL ) if( p_libvlc == NULL )
return NULL; return NULL;
priv = libvlc_priv (p_libvlc);
p_libvlc->p_playlist = NULL; p_libvlc->p_playlist = NULL;
p_libvlc->p_interaction = NULL; p_libvlc->p_interaction = NULL;
priv->p_vlm = NULL; priv->p_vlm = NULL;
p_libvlc->psz_object_name = strdup( "libvlc" ); p_libvlc->psz_object_name = strdup( "libvlc" );
priv = libvlc_priv (p_libvlc);
/* Initialize message queue */ /* Initialize message queue */
msg_Create( p_libvlc ); msg_Create( p_libvlc );
......
...@@ -996,14 +996,11 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname, ...@@ -996,14 +996,11 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
/* to be sure to avoid multiple creation */ /* to be sure to avoid multiple creation */
var_Create( p_this->p_libvlc, "httpd_mutex", VLC_VAR_MUTEX ); var_Create( p_this->p_libvlc, "httpd_mutex", VLC_VAR_MUTEX );
var_Create( p_this->p_libvlc, "httpd_object", VLC_VAR_ADDRESS );
var_Get( p_this->p_libvlc, "httpd_mutex", &lockval ); var_Get( p_this->p_libvlc, "httpd_mutex", &lockval );
vlc_mutex_lock( lockval.p_address ); vlc_mutex_lock( lockval.p_address );
var_Get( p_this->p_libvlc, "httpd_object", &ptrval ); httpd = libvlc_priv (p_this->p_libvlc)->p_httpd;
if( ptrval.p_address != NULL ) if( httpd == NULL )
httpd = ptrval.p_address;
else
{ {
msg_Info( p_this, "creating httpd" ); msg_Info( p_this, "creating httpd" );
httpd = (httpd_t *)vlc_custom_create( p_this, sizeof (*httpd), httpd = (httpd_t *)vlc_custom_create( p_this, sizeof (*httpd),
...@@ -1020,7 +1017,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname, ...@@ -1020,7 +1017,7 @@ httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname,
httpd->host = NULL; httpd->host = NULL;
ptrval.p_address = httpd; ptrval.p_address = httpd;
var_Set( p_this->p_libvlc, "httpd_object", ptrval ); libvlc_priv (p_this->p_libvlc)->p_httpd = httpd;
vlc_object_yield( httpd ); vlc_object_yield( httpd );
vlc_object_attach( httpd, p_this->p_libvlc ); vlc_object_attach( httpd, p_this->p_libvlc );
} }
...@@ -1201,8 +1198,7 @@ void httpd_HostDelete( httpd_host_t *host ) ...@@ -1201,8 +1198,7 @@ void httpd_HostDelete( httpd_host_t *host )
msg_Dbg( httpd, "no host left, stopping httpd" ); msg_Dbg( httpd, "no host left, stopping httpd" );
ptrval.p_address = NULL; libvlc_priv (httpd->p_libvlc)->p_httpd = NULL;
var_Set( httpd->p_libvlc, "httpd_object", ptrval );
vlc_object_detach( httpd ); vlc_object_detach( httpd );
vlc_object_release( httpd ); vlc_object_release( httpd );
......
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