Commit 0d3aa16a authored by Antoine Cellerier's avatar Antoine Cellerier

Add a psz_intf member to intf_thread_t. This holds the string given to...

Add a psz_intf member to intf_thread_t. This holds the string given to module_Need to load the interface (which can then be used by the interface to know what name was used to load it).
parent f2ad0a93
...@@ -60,6 +60,7 @@ struct intf_thread_t ...@@ -60,6 +60,7 @@ struct intf_thread_t
/* Specific interfaces */ /* Specific interfaces */
intf_console_t * p_console; /** console */ intf_console_t * p_console; /** console */
intf_sys_t * p_sys; /** system interface */ intf_sys_t * p_sys; /** system interface */
char * psz_intf; /** intf name specified */
/** Interface module */ /** Interface module */
module_t * p_module; module_t * p_module;
......
...@@ -93,11 +93,13 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module, ...@@ -93,11 +93,13 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module,
} }
/* Choose the best module */ /* Choose the best module */
p_intf->psz_intf = strdup( psz_module );
p_intf->p_module = module_Need( p_intf, "interface", psz_module, VLC_FALSE ); p_intf->p_module = module_Need( p_intf, "interface", psz_module, VLC_FALSE );
if( p_intf->p_module == NULL ) if( p_intf->p_module == NULL )
{ {
msg_Err( p_intf, "no suitable interface module" ); msg_Err( p_intf, "no suitable interface module" );
free( p_intf->psz_intf );
vlc_object_destroy( p_intf ); vlc_object_destroy( p_intf );
return NULL; return NULL;
} }
...@@ -183,6 +185,7 @@ void intf_Destroy( intf_thread_t *p_intf ) ...@@ -183,6 +185,7 @@ void intf_Destroy( intf_thread_t *p_intf )
{ {
module_Unneed( p_intf, p_intf->p_module ); module_Unneed( p_intf, p_intf->p_module );
} }
free( p_intf->psz_intf );
vlc_mutex_destroy( &p_intf->change_lock ); vlc_mutex_destroy( &p_intf->change_lock );
...@@ -290,8 +293,8 @@ static void RunInterface( intf_thread_t *p_intf ) ...@@ -290,8 +293,8 @@ static void RunInterface( intf_thread_t *p_intf )
vlc_mutex_unlock( &p_intf->object_lock ); vlc_mutex_unlock( &p_intf->object_lock );
p_intf->psz_intf = psz_intf;
p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 ); p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 );
free( psz_intf );
} }
while( p_intf->p_module ); while( p_intf->p_module );
} }
......
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