Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
93e1866d
Commit
93e1866d
authored
Feb 07, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules: revector
Also fix module cache loading if int and uint32_t have different sizes.
parent
7e7726e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
55 deletions
+64
-55
src/modules/cache.c
src/modules/cache.c
+64
-55
No files found.
src/modules/cache.c
View file @
93e1866d
...
...
@@ -214,6 +214,68 @@ error:
return
-
1
;
/* FIXME: leaks */
}
static
module_t
*
CacheLoadModule
(
FILE
*
file
)
{
module_t
*
module
=
vlc_module_create
(
NULL
);
/* Load additional infos */
LOAD_STRING
(
module
->
psz_shortname
);
LOAD_STRING
(
module
->
psz_longname
);
LOAD_STRING
(
module
->
psz_help
);
LOAD_IMMEDIATE
(
module
->
i_shortcuts
);
if
(
module
->
i_shortcuts
>
MODULE_SHORTCUT_MAX
)
goto
error
;
else
{
module
->
pp_shortcuts
=
xmalloc
(
sizeof
(
*
module
->
pp_shortcuts
)
*
module
->
i_shortcuts
);
for
(
unsigned
j
=
0
;
j
<
module
->
i_shortcuts
;
j
++
)
LOAD_STRING
(
module
->
pp_shortcuts
[
j
]);
}
LOAD_STRING
(
module
->
psz_capability
);
LOAD_IMMEDIATE
(
module
->
i_score
);
LOAD_IMMEDIATE
(
module
->
b_unloadable
);
/* Config stuff */
if
(
CacheLoadModuleConfig
(
module
,
file
)
!=
VLC_SUCCESS
)
goto
error
;
LOAD_STRING
(
module
->
domain
);
if
(
module
->
domain
!=
NULL
)
vlc_bindtextdomain
(
module
->
domain
);
uint32_t
submodules
;
LOAD_IMMEDIATE
(
submodules
);
for
(;
submodules
>
0
;
submodules
--
)
{
module_t
*
submodule
=
vlc_module_create
(
module
);
free
(
submodule
->
pp_shortcuts
);
LOAD_STRING
(
submodule
->
psz_shortname
);
LOAD_STRING
(
submodule
->
psz_longname
);
LOAD_IMMEDIATE
(
submodule
->
i_shortcuts
);
if
(
submodule
->
i_shortcuts
>
MODULE_SHORTCUT_MAX
)
goto
error
;
else
{
submodule
->
pp_shortcuts
=
xmalloc
(
sizeof
(
*
submodule
->
pp_shortcuts
)
*
submodule
->
i_shortcuts
);
for
(
unsigned
j
=
0
;
j
<
submodule
->
i_shortcuts
;
j
++
)
LOAD_STRING
(
submodule
->
pp_shortcuts
[
j
]);
}
LOAD_STRING
(
submodule
->
psz_capability
);
LOAD_IMMEDIATE
(
submodule
->
i_score
);
}
return
module
;
error:
return
NULL
;
/* FIXME: leaks */
}
/**
* Loads a plugins cache file.
...
...
@@ -308,63 +370,10 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
for
(
size_t
count
=
0
;
count
<
i_cache
;)
{
module_t
*
module
;
int
i_submodules
;
module
=
vlc_module_create
(
NULL
);
/* Load additional infos */
LOAD_STRING
(
module
->
psz_shortname
);
LOAD_STRING
(
module
->
psz_longname
);
LOAD_STRING
(
module
->
psz_help
);
LOAD_IMMEDIATE
(
module
->
i_shortcuts
);
if
(
module
->
i_shortcuts
>
MODULE_SHORTCUT_MAX
)
goto
error
;
else
{
module
->
pp_shortcuts
=
xmalloc
(
sizeof
(
*
module
->
pp_shortcuts
)
*
module
->
i_shortcuts
);
for
(
unsigned
j
=
0
;
j
<
module
->
i_shortcuts
;
j
++
)
LOAD_STRING
(
module
->
pp_shortcuts
[
j
]);
}
LOAD_STRING
(
module
->
psz_capability
);
LOAD_IMMEDIATE
(
module
->
i_score
);
LOAD_IMMEDIATE
(
module
->
b_unloadable
);
/* Config stuff */
if
(
CacheLoadModuleConfig
(
module
,
file
)
!=
VLC_SUCCESS
)
module_t
*
module
=
CacheLoadModule
(
file
);
if
(
module
==
NULL
)
goto
error
;
LOAD_STRING
(
module
->
domain
);
if
(
module
->
domain
!=
NULL
)
vlc_bindtextdomain
(
module
->
domain
);
LOAD_IMMEDIATE
(
i_submodules
);
while
(
i_submodules
--
)
{
module_t
*
submodule
=
vlc_module_create
(
module
);
free
(
submodule
->
pp_shortcuts
);
LOAD_STRING
(
submodule
->
psz_shortname
);
LOAD_STRING
(
submodule
->
psz_longname
);
LOAD_IMMEDIATE
(
submodule
->
i_shortcuts
);
if
(
submodule
->
i_shortcuts
>
MODULE_SHORTCUT_MAX
)
goto
error
;
else
{
submodule
->
pp_shortcuts
=
xmalloc
(
sizeof
(
*
submodule
->
pp_shortcuts
)
*
submodule
->
i_shortcuts
);
for
(
unsigned
j
=
0
;
j
<
submodule
->
i_shortcuts
;
j
++
)
LOAD_STRING
(
submodule
->
pp_shortcuts
[
j
]);
}
LOAD_STRING
(
submodule
->
psz_capability
);
LOAD_IMMEDIATE
(
submodule
->
i_score
);
}
char
*
path
;
struct
stat
st
;
...
...
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