Commit e55fc1b4 authored by Antoine Cellerier's avatar Antoine Cellerier

* add core option --vlm-conf

   specifies a vlm configuration file to load when vlm is launched
parent 86306d01
......@@ -626,6 +626,11 @@ static char *ppsz_align_descriptions[] =
"This option allows you to specify an additional path for VLC to look " \
"for its modules.")
#define VLM_CONF_TEXT N_("VLM configuration file")
#define VLM_CONF_LONGTEXT N_( \
"This option allows you to specify a VLM configuration file that will " \
"be read when VLM is launched.")
#define PLUGINS_CACHE_TEXT N_("Use a plugins cache")
#define PLUGINS_CACHE_LONGTEXT N_( \
"This option allows you to use a plugins cache which will greatly " \
......@@ -1048,6 +1053,8 @@ vlc_module_begin();
PLUGINS_CACHE_LONGTEXT, VLC_TRUE );
add_directory( "plugin-path", NULL, NULL, PLUGIN_PATH_TEXT,
PLUGIN_PATH_LONGTEXT, VLC_TRUE );
add_string( "vlm-conf", NULL, NULL, VLM_CONF_TEXT,
VLM_CONF_LONGTEXT, VLC_TRUE );
#if !defined(WIN32)
add_bool( "daemon", 0, NULL, DAEMON_TEXT, DAEMON_LONGTEXT, VLC_TRUE );
......
......@@ -116,7 +116,29 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
return NULL;
}
return p_vlm;
/* try loading the vlm conf file given by --vlm-conf */
char *psz_vlmconf = config_GetPsz( p_vlm, "vlm-conf" );
if( psz_vlmconf && *psz_vlmconf )
{
vlm_message_t *p_message = NULL;
char *psz_buffer = NULL;
msg_Dbg( p_this, "loading vlm conf ..." );
asprintf(&psz_buffer, "load %s", psz_vlmconf );
if( psz_buffer )
{
msg_Dbg( p_this, psz_buffer);
if( vlm_ExecuteCommand( p_vlm, psz_buffer, &p_message ) ){
msg_Warn( p_this, "error while loading the vlm conf file" );
}
free(p_message);
free(psz_buffer);
}
}
free(psz_vlmconf);
return p_vlm;
}
/*****************************************************************************
......
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