Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
d6d444d2
Commit
d6d444d2
authored
May 06, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to keep the config file around all the time
parent
0c88710e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
28 deletions
+17
-28
src/config/file.c
src/config/file.c
+17
-19
src/libvlc.c
src/libvlc.c
+0
-8
src/libvlc.h
src/libvlc.h
+0
-1
No files found.
src/config/file.c
View file @
d6d444d2
...
...
@@ -65,13 +65,12 @@ static char *config_GetConfigFile( void )
static
FILE
*
config_OpenConfigFile
(
vlc_object_t
*
p_obj
,
const
char
*
mode
)
{
char
*
psz_filename
=
libvlc_priv
(
p_obj
->
p_libvlc
)
->
psz_configfile
;
char
*
psz_filename
;
FILE
*
p_stream
;
psz_filename
=
config_GetCustomConfigFile
(
p_obj
->
p_libvlc
);
if
(
!
psz_filename
)
{
psz_filename
=
config_GetConfigFile
();
}
msg_Dbg
(
p_obj
,
"opening config file (%s)"
,
psz_filename
);
...
...
@@ -121,11 +120,6 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
}
}
#endif
else
if
(
p_stream
!=
NULL
)
{
libvlc_priv
(
p_obj
->
p_libvlc
)
->
psz_configfile
=
psz_filename
;
}
return
p_stream
;
}
...
...
@@ -391,6 +385,17 @@ config_Write (FILE *file, const char *type, const char *desc,
}
static
int
config_PrepareDir
(
vlc_object_t
*
obj
)
{
char
*
psz_configdir
=
config_GetUserConfDir
();
if
(
psz_configdir
==
NULL
)
/* XXX: This should never happen */
return
-
1
;
int
ret
=
config_CreateDir
(
obj
,
psz_configdir
);
free
(
psz_configdir
);
return
ret
;
}
/*****************************************************************************
* config_SaveConfigFile: Save a module's config options.
*****************************************************************************
...
...
@@ -425,18 +430,11 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
/* Acquire config file lock */
vlc_mutex_lock
(
&
priv
->
config_lock
);
if
(
libvlc_priv
(
p_this
->
p_libvlc
)
->
psz_configfile
==
NULL
)
if
(
config_PrepareDir
(
p_this
)
)
{
char
*
psz_configdir
=
config_GetUserConfDir
();
if
(
!
psz_configdir
)
/* XXX: This should never happen */
{
msg_Err
(
p_this
,
"no configuration directory defined"
);
vlc_mutex_unlock
(
&
priv
->
config_lock
);
return
-
1
;
}
config_CreateDir
(
p_this
,
psz_configdir
);
free
(
psz_configdir
);
msg_Err
(
p_this
,
"no configuration directory"
);
vlc_mutex_unlock
(
&
priv
->
config_lock
);
return
-
1
;
}
file
=
config_OpenConfigFile
(
p_this
,
"rt"
);
...
...
src/libvlc.c
View file @
d6d444d2
...
...
@@ -358,9 +358,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
i_ret
=
VLC_EEXITSUCCESS
;
}
/* Set the config file stuff */
priv
->
psz_configfile
=
config_GetCustomConfigFile
(
p_libvlc
);
/* Check for plugins cache options */
bool
b_cache_delete
=
config_GetInt
(
p_libvlc
,
"reset-plugins-cache"
)
>
0
;
...
...
@@ -431,7 +428,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if
(
b_exit
)
{
free
(
priv
->
psz_configfile
);
module_EndBank
(
p_libvlc
,
false
);
return
i_ret
;
}
...
...
@@ -543,7 +539,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if
(
b_exit
)
{
free
(
priv
->
psz_configfile
);
module_EndBank
(
p_libvlc
,
true
);
return
i_ret
;
}
...
...
@@ -571,7 +566,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
"that they are valid.
\n
"
);
PauseConsole
();
#endif
free
(
priv
->
psz_configfile
);
module_EndBank
(
p_libvlc
,
true
);
return
VLC_EGENERIC
;
}
...
...
@@ -831,7 +825,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
module_unneed
(
p_libvlc
,
priv
->
p_memcpy_module
);
}
module_EndBank
(
p_libvlc
,
true
);
free
(
priv
->
psz_configfile
);
return
VLC_EGENERIC
;
}
playlist_Activate
(
p_playlist
);
...
...
@@ -1107,7 +1100,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
/* Free module bank. It is refcounted, so we call this each time */
module_EndBank
(
p_libvlc
,
true
);
FREENULL
(
priv
->
psz_configfile
);
var_DelCallback
(
p_libvlc
,
"key-pressed"
,
vlc_key_to_action
,
(
void
*
)
p_libvlc
->
p_hotkeys
);
free
(
(
void
*
)
p_libvlc
->
p_hotkeys
);
...
...
src/libvlc.h
View file @
d6d444d2
...
...
@@ -203,7 +203,6 @@ typedef struct libvlc_priv_t
/* Configuration */
vlc_mutex_t
config_lock
;
///< config file lock
char
*
psz_configfile
;
///< location of config file
int
i_last_input_id
;
///< Last id of input item
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment