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
b91341a3
Commit
b91341a3
authored
Aug 21, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load plugins and configuration as soon as possible
No need to load the config file twice anymore.
parent
2ba95974
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
55 deletions
+49
-55
src/libvlc.c
src/libvlc.c
+40
-52
src/modules/bank.c
src/modules/bank.c
+8
-2
src/modules/modules.h
src/modules/modules.h
+1
-1
No files found.
src/libvlc.c
View file @
b91341a3
...
@@ -259,18 +259,55 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -259,18 +259,55 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
* options) */
* options) */
module_InitBank
();
module_InitBank
();
/* Get command line options that affect module loading. */
if
(
config_LoadCmdLine
(
p_libvlc
,
i_argc
,
ppsz_argv
,
NULL
)
)
if
(
config_LoadCmdLine
(
p_libvlc
,
i_argc
,
ppsz_argv
,
NULL
)
)
{
{
module_EndBank
(
false
);
module_EndBank
(
false
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
priv
->
i_verbose
=
var_InheritInteger
(
p_libvlc
,
"verbose"
);
priv
->
i_verbose
=
var_InheritInteger
(
p_libvlc
,
"verbose"
);
/* Announce who we are - Do it only for first instance ? */
/* Announce who we are (TODO: only first instance?) */
msg_Dbg
(
p_libvlc
,
"VLC media player - %s"
,
VERSION_MESSAGE
);
msg_Dbg
(
p_libvlc
,
"VLC media player - %s"
,
VERSION_MESSAGE
);
msg_Dbg
(
p_libvlc
,
"%s"
,
COPYRIGHT_MESSAGE
);
msg_Dbg
(
p_libvlc
,
"%s"
,
COPYRIGHT_MESSAGE
);
msg_Dbg
(
p_libvlc
,
"revision %s"
,
psz_vlc_changeset
);
msg_Dbg
(
p_libvlc
,
"revision %s"
,
psz_vlc_changeset
);
msg_Dbg
(
p_libvlc
,
"configured with %s"
,
CONFIGURE_LINE
);
msg_Dbg
(
p_libvlc
,
"configured with %s"
,
CONFIGURE_LINE
);
/* Load the builtins and plugins into the module_bank.
* We have to do it before config_Load*() because this also gets the
* list of configuration options exported by each module and loads their
* default values. */
size_t
module_count
=
module_LoadPlugins
(
p_libvlc
);
/*
* Override default configuration with config file settings
*/
if
(
!
var_InheritBool
(
p_libvlc
,
"ignore-config"
)
)
{
if
(
var_InheritBool
(
p_libvlc
,
"reset-config"
)
)
config_SaveConfigFile
(
p_libvlc
);
/* Save default config */
else
config_LoadConfigFile
(
p_libvlc
);
}
/*
* Override configuration with command line settings
*/
int
vlc_optind
;
if
(
config_LoadCmdLine
(
p_libvlc
,
i_argc
,
ppsz_argv
,
&
vlc_optind
)
)
{
#ifdef WIN32
ShowConsole
(
false
);
/* Pause the console because it's destroyed when we exit */
fprintf
(
stderr
,
"The command line options couldn't be loaded, check "
"that they are valid.
\n
"
);
PauseConsole
();
#endif
module_EndBank
(
true
);
return
VLC_EGENERIC
;
}
priv
->
i_verbose
=
var_InheritInteger
(
p_libvlc
,
"verbose"
);
/*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
/*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
msg_Dbg
(
p_libvlc
,
"translation test: code is
\"
%s
\"
"
,
_
(
"C"
)
);
msg_Dbg
(
p_libvlc
,
"translation test: code is
\"
%s
\"
"
,
_
(
"C"
)
);
...
@@ -356,7 +393,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -356,7 +393,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if
(
b_exit
)
if
(
b_exit
)
{
{
module_EndBank
(
fals
e
);
module_EndBank
(
tru
e
);
return
i_ret
;
return
i_ret
;
}
}
...
@@ -364,10 +401,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -364,10 +401,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
#if defined( ENABLE_NLS ) \
#if defined( ENABLE_NLS ) \
&& ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
&& ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
# if defined (WIN32) || defined (__APPLE__)
# if defined (WIN32) || defined (__APPLE__)
if
(
!
var_InheritBool
(
p_libvlc
,
"ignore-config"
)
)
config_LoadConfigFile
(
p_libvlc
);
priv
->
i_verbose
=
var_InheritInteger
(
p_libvlc
,
"verbose"
);
/* Check if the user specified a custom language */
/* Check if the user specified a custom language */
psz_language
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"language"
);
psz_language
=
var_CreateGetNonEmptyString
(
p_libvlc
,
"language"
);
if
(
psz_language
&&
strcmp
(
psz_language
,
"auto"
)
)
if
(
psz_language
&&
strcmp
(
psz_language
,
"auto"
)
)
...
@@ -382,19 +415,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -382,19 +415,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
# endif
# endif
#endif
#endif
/*
* Load the builtins and plugins into the module_bank.
* We have to do it before config_Load*() because this also gets the
* list of configuration options exported by each module and loads their
* default values.
*/
module_LoadPlugins
(
p_libvlc
);
size_t
module_count
;
module_t
**
list
=
module_list_get
(
&
module_count
);
module_list_free
(
list
);
msg_Dbg
(
p_libvlc
,
"module bank initialized (%zu modules)"
,
module_count
);
/* Check for help on modules */
/* Check for help on modules */
if
(
(
p_tmp
=
var_InheritString
(
p_libvlc
,
"module"
))
)
if
(
(
p_tmp
=
var_InheritString
(
p_libvlc
,
"module"
))
)
{
{
...
@@ -448,38 +468,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -448,38 +468,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
return
i_ret
;
return
i_ret
;
}
}
/*
* Override default configuration with config file settings
*/
if
(
!
var_InheritBool
(
p_libvlc
,
"ignore-config"
)
)
{
if
(
var_InheritBool
(
p_libvlc
,
"reset-config"
)
)
{
config_ResetAll
(
p_libvlc
);
config_SaveConfigFile
(
p_libvlc
);
}
else
config_LoadConfigFile
(
p_libvlc
);
}
/*
* Override configuration with command line settings
*/
int
vlc_optind
;
if
(
config_LoadCmdLine
(
p_libvlc
,
i_argc
,
ppsz_argv
,
&
vlc_optind
)
)
{
#ifdef WIN32
ShowConsole
(
false
);
/* Pause the console because it's destroyed when we exit */
fprintf
(
stderr
,
"The command line options couldn't be loaded, check "
"that they are valid.
\n
"
);
PauseConsole
();
#endif
module_EndBank
(
true
);
return
VLC_EGENERIC
;
}
priv
->
i_verbose
=
var_InheritInteger
(
p_libvlc
,
"verbose"
);
/* FIXME: could be replaced by using Unix sockets */
/* FIXME: could be replaced by using Unix sockets */
#ifdef HAVE_DBUS
#ifdef HAVE_DBUS
dbus_threads_init_default
();
dbus_threads_init_default
();
...
...
src/modules/bank.c
View file @
b91341a3
...
@@ -152,9 +152,9 @@ void module_EndBank (bool b_plugins)
...
@@ -152,9 +152,9 @@ void module_EndBank (bool b_plugins)
* Fills the module bank structure with the plugin modules.
* Fills the module bank structure with the plugin modules.
*
*
* \param p_this vlc object structure
* \param p_this vlc object structure
* \return
nothing
* \return
total number of modules in bank after loading all plug-ins
*/
*/
void
module_LoadPlugins
(
vlc_object_t
*
obj
)
size_t
module_LoadPlugins
(
vlc_object_t
*
obj
)
{
{
/*vlc_assert_locked (&modules.lock); not for static mutexes :( */
/*vlc_assert_locked (&modules.lock); not for static mutexes :( */
...
@@ -168,6 +168,12 @@ void module_LoadPlugins (vlc_object_t *obj)
...
@@ -168,6 +168,12 @@ void module_LoadPlugins (vlc_object_t *obj)
}
}
#endif
#endif
vlc_mutex_unlock
(
&
modules
.
lock
);
vlc_mutex_unlock
(
&
modules
.
lock
);
size_t
count
;
module_t
**
list
=
module_list_get
(
&
count
);
module_list_free
(
list
);
msg_Dbg
(
obj
,
"plug-ins loaded: %zu modules"
,
count
);
return
count
;
}
}
/**
/**
...
...
src/modules/modules.h
View file @
b91341a3
...
@@ -105,7 +105,7 @@ module_t *vlc_module_create (module_t *);
...
@@ -105,7 +105,7 @@ module_t *vlc_module_create (module_t *);
void
vlc_module_destroy
(
module_t
*
);
void
vlc_module_destroy
(
module_t
*
);
void
module_InitBank
(
void
);
void
module_InitBank
(
void
);
void
module_LoadPlugins
(
vlc_object_t
*
);
size_t
module_LoadPlugins
(
vlc_object_t
*
);
#define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
#define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
void
module_EndBank
(
bool
);
void
module_EndBank
(
bool
);
int
module_Map
(
vlc_object_t
*
,
module_t
*
);
int
module_Map
(
vlc_object_t
*
,
module_t
*
);
...
...
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