[vlc-devel] commit: Privatize psz_configfile ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun May 4 20:15:55 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sun May 4 21:17:04 2008 +0300| [cf825526dc105c5b0975ed9b5596cccb9d9bd493]
Privatize psz_configfile
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf825526dc105c5b0975ed9b5596cccb9d9bd493
---
include/vlc_main.h | 2 --
src/config/file.c | 6 +++---
src/libvlc-common.c | 4 ++--
src/libvlc.h | 2 ++
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/vlc_main.h b/include/vlc_main.h
index 1f9ae73..9039cb8 100644
--- a/include/vlc_main.h
+++ b/include/vlc_main.h
@@ -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)
diff --git a/src/config/file.c b/src/config/file.c
index 26b6855..57e55b8 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -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 */
diff --git a/src/libvlc-common.c b/src/libvlc-common.c
index 068392b..7be719c 100644
--- a/src/libvlc-common.c
+++ b/src/libvlc-common.c
@@ -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 );
diff --git a/src/libvlc.h b/src/libvlc.h
index 8377dc9..9088550 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -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
More information about the vlc-devel
mailing list