Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1661fa70
Commit
1661fa70
authored
Aug 13, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass struct stat pointer when looking up a plugin in the cache
parent
7cc97eda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
src/modules/cache.c
src/modules/cache.c
+8
-7
src/modules/modules.c
src/modules/modules.c
+6
-7
src/modules/modules.h
src/modules/modules.h
+1
-1
No files found.
src/modules/cache.c
View file @
1661fa70
...
...
@@ -38,6 +38,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -632,19 +633,19 @@ void CacheMerge( vlc_object_t *p_this, module_t *p_cache, module_t *p_module )
p_module
->
b_loaded
=
false
;
}
/**
***************************************************************************
*
CacheFind: finds the cache entry corresponding to a file
*
****************************************************************************
/
module_t
*
CacheFind
(
module_bank_t
*
p_bank
,
const
char
*
path
,
time_t
mtime
,
off_t
size
)
/**
*
Looks up a plugin file in a list of cached plugins.
*/
module_t
*
CacheFind
(
module_bank_t
*
p_bank
,
const
char
*
path
,
const
struct
stat
*
st
)
{
module_cache_t
**
cache
=
p_bank
->
pp_loaded_cache
;
size_t
n
=
p_bank
->
i_loaded_cache
;
for
(
size_t
i
=
0
;
i
<
n
;
i
++
)
if
(
!
strcmp
(
cache
[
i
]
->
path
,
path
)
&&
cache
[
i
]
->
mtime
==
mtime
&&
cache
[
i
]
->
size
==
s
ize
)
&&
cache
[
i
]
->
mtime
==
st
->
st_
mtime
&&
cache
[
i
]
->
size
==
s
t
->
st_size
)
{
module_t
*
module
=
cache
[
i
]
->
p_module
;
cache
[
i
]
->
p_module
=
NULL
;
...
...
src/modules/modules.c
View file @
1661fa70
...
...
@@ -74,7 +74,7 @@ static void AllocatePluginPath( vlc_object_t *, module_bank_t *, const char *,
static
void
AllocatePluginDir
(
vlc_object_t
*
,
module_bank_t
*
,
const
char
*
,
unsigned
,
cache_mode_t
);
static
int
AllocatePluginFile
(
vlc_object_t
*
,
module_bank_t
*
,
const
char
*
,
time_t
,
off_t
,
cache_mode_t
);
const
struct
stat
*
,
cache_mode_t
);
static
module_t
*
AllocatePlugin
(
vlc_object_t
*
,
const
char
*
,
bool
);
#endif
static
int
AllocateBuiltinModule
(
vlc_object_t
*
,
int
(
*
)
(
module_t
*
)
);
...
...
@@ -945,8 +945,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, module_bank_t *p_bank,
&&
!
strncasecmp
(
path
+
pathlen
-
strlen
(
"_plugin"
LIBEXT
),
"_plugin"
LIBEXT
,
strlen
(
"_plugni"
LIBEXT
)))
/* ^^ We only load files matching "lib*_plugin"LIBEXT */
AllocatePluginFile
(
p_this
,
p_bank
,
path
,
st
.
st_mtime
,
st
.
st_size
,
mode
);
AllocatePluginFile
(
p_this
,
p_bank
,
path
,
&
st
,
mode
);
free
(
path
);
}
...
...
@@ -961,7 +960,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, module_bank_t *p_bank,
* and module_unneed. It can be removed by DeleteModule.
*****************************************************************************/
static
int
AllocatePluginFile
(
vlc_object_t
*
p_this
,
module_bank_t
*
p_bank
,
const
char
*
path
,
time_t
mtime
,
off_t
size
,
const
char
*
path
,
const
struct
stat
*
st
,
cache_mode_t
mode
)
{
module_t
*
p_module
=
NULL
;
...
...
@@ -970,7 +969,7 @@ static int AllocatePluginFile( vlc_object_t * p_this, module_bank_t *p_bank,
p_module->psz_object_name, p_module->psz_longname ); */
/* Check our plugins cache first then load plugin if needed */
if
(
mode
==
CACHE_USE
)
p_module
=
CacheFind
(
p_bank
,
path
,
mtime
,
size
);
p_module
=
CacheFind
(
p_bank
,
path
,
st
);
if
(
p_module
==
NULL
)
p_module
=
AllocatePlugin
(
p_this
,
path
,
true
);
if
(
p_module
==
NULL
)
...
...
@@ -1016,8 +1015,8 @@ static int AllocatePluginFile( vlc_object_t * p_this, module_bank_t *p_bank,
if
(
pp_cache
[
p_bank
->
i_cache
]
==
NULL
)
return
-
1
;
pp_cache
[
p_bank
->
i_cache
]
->
path
=
strdup
(
path
);
pp_cache
[
p_bank
->
i_cache
]
->
mtime
=
mtime
;
pp_cache
[
p_bank
->
i_cache
]
->
size
=
size
;
pp_cache
[
p_bank
->
i_cache
]
->
mtime
=
st
->
st_
mtime
;
pp_cache
[
p_bank
->
i_cache
]
->
size
=
s
t
->
st_s
ize
;
pp_cache
[
p_bank
->
i_cache
]
->
p_module
=
p_module
;
p_bank
->
pp_cache
=
pp_cache
;
p_bank
->
i_cache
++
;
...
...
src/modules/modules.h
View file @
1661fa70
...
...
@@ -150,6 +150,6 @@ void CacheMerge (vlc_object_t *, module_t *, module_t *);
void
CacheDelete
(
vlc_object_t
*
,
const
char
*
);
size_t
CacheLoad
(
vlc_object_t
*
,
const
char
*
,
module_cache_t
***
);
void
CacheSave
(
vlc_object_t
*
,
const
char
*
,
module_cache_t
*
const
*
,
size_t
);
module_t
*
CacheFind
(
module_bank_t
*
,
const
char
*
,
time_t
,
off_t
);
module_t
*
CacheFind
(
module_bank_t
*
,
const
char
*
,
const
struct
stat
*
);
#endif
/* !LIBVLC_MODULES_H */
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