Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e083d4a7
Commit
e083d4a7
authored
Sep 21, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module really does not need to be an object
parent
8fce3d90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
src/libvlc.c
src/libvlc.c
+4
-2
src/modules/modules.c
src/modules/modules.c
+18
-18
src/modules/modules.h
src/modules/modules.h
+1
-3
No files found.
src/libvlc.c
View file @
e083d4a7
...
@@ -491,8 +491,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
...
@@ -491,8 +491,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
b_exit
=
true
;
b_exit
=
true
;
}
}
msg_Dbg
(
p_libvlc
,
"module bank initialized, found %i modules"
,
size_t
module_count
;
vlc_internals
(
p_module_bank
)
->
i_children
);
module_t
**
list
=
module_list_get
(
&
module_count
);
module_list_free
(
list
);
msg_Dbg
(
p_libvlc
,
"module bank initialized (%u modules)"
,
module_count
);
/* Check for help on modules */
/* Check for help on modules */
if
(
(
p_tmp
=
config_GetPsz
(
p_libvlc
,
"module"
))
)
if
(
(
p_tmp
=
config_GetPsz
(
p_libvlc
,
"module"
))
)
...
...
src/modules/modules.c
View file @
e083d4a7
...
@@ -124,8 +124,7 @@ void __module_InitBank( vlc_object_t *p_this )
...
@@ -124,8 +124,7 @@ void __module_InitBank( vlc_object_t *p_this )
if
(
p_module_bank
==
NULL
)
if
(
p_module_bank
==
NULL
)
{
{
p_bank
=
vlc_custom_create
(
p_this
,
sizeof
(
module_bank_t
),
p_bank
=
calloc
(
1
,
sizeof
(
*
p_bank
));
VLC_OBJECT_GENERIC
,
"module bank"
);
p_bank
->
i_usage
=
1
;
p_bank
->
i_usage
=
1
;
p_bank
->
i_cache
=
p_bank
->
i_loaded_cache
=
0
;
p_bank
->
i_cache
=
p_bank
->
i_loaded_cache
=
0
;
p_bank
->
pp_cache
=
p_bank
->
pp_loaded_cache
=
NULL
;
p_bank
->
pp_cache
=
p_bank
->
pp_loaded_cache
=
NULL
;
...
@@ -160,26 +159,24 @@ void __module_InitBank( vlc_object_t *p_this )
...
@@ -160,26 +159,24 @@ void __module_InitBank( vlc_object_t *p_this )
*/
*/
void
__module_EndBank
(
vlc_object_t
*
p_this
)
void
__module_EndBank
(
vlc_object_t
*
p_this
)
{
{
module_
t
*
p_next
=
NULL
;
module_
bank_t
*
p_bank
;
vlc_mutex_t
*
lock
=
var_AcquireMutex
(
"libvlc"
);
vlc_mutex_t
*
lock
=
var_AcquireMutex
(
"libvlc"
);
if
(
!
p_module_bank
)
p_bank
=
p_module_bank
;
{
assert
(
p_bank
!=
NULL
);
vlc_mutex_unlock
(
lock
);
if
(
--
p_bank
->
i_usage
>
0
)
return
;
}
if
(
--
p_module_bank
->
i_usage
)
{
{
vlc_mutex_unlock
(
lock
);
vlc_mutex_unlock
(
lock
);
return
;
return
;
}
}
/*FIXME: For thread safety, we need to:
p_module_bank = NULL; - immediately, but that will crash the cache */
vlc_mutex_unlock
(
lock
);
vlc_mutex_unlock
(
lock
);
/* Save the configuration */
/* Save the configuration */
config_AutoSaveConfigFile
(
p_this
);
config_AutoSaveConfigFile
(
p_this
);
#ifdef HAVE_DYNAMIC_PLUGINS
#ifdef HAVE_DYNAMIC_PLUGINS
# define p_bank p_module_bank
if
(
p_bank
->
b_cache
)
CacheSave
(
p_this
);
if
(
p_bank
->
b_cache
)
CacheSave
(
p_this
);
while
(
p_bank
->
i_loaded_cache
--
)
while
(
p_bank
->
i_loaded_cache
--
)
{
{
...
@@ -209,17 +206,13 @@ void __module_EndBank( vlc_object_t *p_this )
...
@@ -209,17 +206,13 @@ void __module_EndBank( vlc_object_t *p_this )
free
(
p_bank
->
pp_cache
);
free
(
p_bank
->
pp_cache
);
p_bank
->
pp_cache
=
NULL
;
p_bank
->
pp_cache
=
NULL
;
}
}
# undef p_bank
#endif
#endif
while
(
vlc_internals
(
p_module_bank
)
->
i_children
)
while
(
p_bank
->
head
!=
NULL
)
{
DeleteModule
(
p_bank
->
head
,
true
);
p_next
=
(
module_t
*
)
vlc_internals
(
p_module_bank
)
->
pp_children
[
0
];
DeleteModule
(
p_next
,
true
);
}
vlc_object_release
(
p_module_bank
);
p_module_bank
=
NULL
;
/* FIXME: do this inside the lock */
p_module_bank
=
NULL
;
free
(
p_bank
)
;
}
}
/**
/**
...
@@ -1413,6 +1406,13 @@ static void DeleteModule( module_t * p_module, bool b_detach )
...
@@ -1413,6 +1406,13 @@ static void DeleteModule( module_t * p_module, bool b_detach )
{
{
assert
(
p_module
);
assert
(
p_module
);
/* Unlist the module (if it is in the list) */
module_t
**
pp_self
=
&
p_module_bank
->
head
;
while
(
*
pp_self
!=
NULL
&&
*
pp_self
!=
p_module
)
pp_self
=
&
((
*
pp_self
)
->
next
);
if
(
*
pp_self
)
*
pp_self
=
p_module
->
next
;
/* We free the structures that we strdup()ed in Allocate*Module(). */
/* We free the structures that we strdup()ed in Allocate*Module(). */
#ifdef HAVE_DYNAMIC_PLUGINS
#ifdef HAVE_DYNAMIC_PLUGINS
if
(
!
p_module
->
b_builtin
)
if
(
!
p_module
->
b_builtin
)
...
...
src/modules/modules.h
View file @
e083d4a7
...
@@ -39,9 +39,7 @@
...
@@ -39,9 +39,7 @@
*****************************************************************************/
*****************************************************************************/
struct
module_bank_t
struct
module_bank_t
{
{
VLC_COMMON_MEMBERS
unsigned
i_usage
;
int
i_usage
;
bool
b_builtins
;
bool
b_builtins
;
bool
b_plugins
;
bool
b_plugins
;
...
...
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