Commit cf825526 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Privatize psz_configfile

parent 26d208e5
......@@ -43,8 +43,6 @@ struct libvlc_int_t
char * psz_datadir; ///< user's data directory
char * psz_cachedir; ///< user's cache directory
char * psz_configfile; ///< location of config file
playlist_t *p_playlist; ///< playlist object
void *p_stats_computer; ///< Input thread computing stats (needs cleanup)
......
......@@ -46,7 +46,7 @@ static inline char *strdupnull (const char *src)
static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
{
char *psz_filename = p_obj->p_libvlc->psz_configfile;
char *psz_filename = libvlc_priv (p_obj->p_libvlc)->psz_configfile;
FILE *p_stream;
if( !psz_filename )
......@@ -105,7 +105,7 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
#endif
else if( p_stream != NULL )
{
p_obj->p_libvlc->psz_configfile = psz_filename;
libvlc_priv (p_obj->p_libvlc)->psz_configfile = psz_filename;
}
return p_stream;
......@@ -400,7 +400,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
/* Acquire config file lock */
vlc_mutex_lock( &priv->config_lock );
if( p_this->p_libvlc->psz_configfile == NULL )
if( libvlc_priv (p_this->p_libvlc)->psz_configfile == NULL )
{
const char *psz_configdir = p_this->p_libvlc->psz_configdir;
if( !psz_configdir ) /* XXX: This should never happen */
......
......@@ -304,7 +304,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
p_libvlc->psz_configdir = config_GetConfigDir( p_libvlc );
p_libvlc->psz_datadir = config_GetUserDataDir( p_libvlc );
p_libvlc->psz_cachedir = config_GetCacheDir( p_libvlc );
p_libvlc->psz_configfile = config_GetCustomConfigFile( p_libvlc );
priv->psz_configfile = config_GetCustomConfigFile( p_libvlc );
/* Check for plugins cache options */
if( config_GetInt( p_libvlc, "reset-plugins-cache" ) > 0 )
......@@ -1070,7 +1070,7 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
FREENULL( p_libvlc->psz_configdir );
FREENULL( p_libvlc->psz_datadir );
FREENULL( p_libvlc->psz_cachedir );
FREENULL( p_libvlc->psz_configfile );
FREENULL( priv->psz_configfile );
var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
p_libvlc->p_hotkeys );
FREENULL( p_libvlc->p_hotkeys );
......
......@@ -208,7 +208,9 @@ static inline vlc_object_internals_t *vlc_internals( vlc_object_t *obj )
*/
typedef struct libvlc_priv_t
{
/* Configuration */
vlc_mutex_t config_lock; ///< config file lock
char * psz_configfile; ///< location of config file
/* Messages */
msg_bank_t msg_bank; ///< The message bank
......
Supports Markdown
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