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
1eba7a33
Commit
1eba7a33
authored
Oct 28, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/modules.c: include current language in cache file.
parent
62f7a588
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
src/misc/modules.c
src/misc/modules.c
+33
-2
No files found.
src/misc/modules.c
View file @
1eba7a33
...
...
@@ -1548,9 +1548,10 @@ static void CacheLoad( vlc_object_t *p_this )
FILE
*
file
;
int
i
,
j
,
i_size
,
i_read
;
char
p_cachestring
[
sizeof
(
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
)];
char
p_cachelang
[
6
],
p_lang
[
6
];
int
i_cache
;
module_cache_t
**
pp_cache
=
0
;
int32_t
i_file_size
;
int32_t
i_file_size
,
i_marker
;
psz_homedir
=
p_this
->
p_vlc
->
psz_homedir
;
if
(
!
psz_homedir
)
...
...
@@ -1561,7 +1562,7 @@ static void CacheLoad( vlc_object_t *p_this )
i_size
=
asprintf
(
&
psz_filename
,
"%s/%s/%s/%s"
,
psz_homedir
,
CONFIG_DIR
,
PLUGINSCACHE_DIR
,
CacheName
()
);
if
(
!
i_size
)
if
(
i_size
<=
0
)
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
...
...
@@ -1623,6 +1624,29 @@ static void CacheLoad( vlc_object_t *p_this )
return
;
}
/* Check the language hasn't changed */
sprintf
(
p_lang
,
"%5.5s"
,
_
(
"C"
)
);
i_size
=
5
;
i_read
=
fread
(
p_cachelang
,
sizeof
(
char
),
i_size
,
file
);
if
(
i_read
!=
i_size
||
memcmp
(
p_cachelang
,
p_lang
,
i_size
)
)
{
msg_Warn
(
p_this
,
"This doesn't look like a valid plugins cache "
"(language changed)"
);
msg_Warn
(
p_this
,
"lang: %s, %s"
,
p_cachelang
,
p_lang
);
fclose
(
file
);
return
;
}
/* Check header marker */
i_read
=
fread
(
&
i_marker
,
sizeof
(
char
),
sizeof
(
i_marker
),
file
);
if
(
i_read
!=
sizeof
(
i_marker
)
||
i_marker
!=
ftell
(
file
)
-
(
int
)
sizeof
(
i_marker
)
)
{
msg_Warn
(
p_this
,
"This doesn't look like a valid plugins cache "
"(corrupted header)"
);
fclose
(
file
);
return
;
}
p_this
->
p_libvlc
->
p_module_bank
->
i_loaded_cache
=
0
;
fread
(
&
i_cache
,
sizeof
(
char
),
sizeof
(
i_cache
),
file
);
pp_cache
=
p_this
->
p_libvlc
->
p_module_bank
->
pp_loaded_cache
=
...
...
@@ -1891,6 +1915,13 @@ static void CacheSave( vlc_object_t *p_this )
/* Contains version number */
fprintf
(
file
,
"%s"
,
PLUGINSCACHE_DIR
COPYRIGHT_MESSAGE
);
/* Language */
fprintf
(
file
,
"%5.5s"
,
_
(
"C"
)
);
/* Header marker */
i_file_size
=
ftell
(
file
);
fwrite
(
&
i_file_size
,
sizeof
(
char
),
sizeof
(
i_file_size
),
file
);
i_cache
=
p_this
->
p_libvlc
->
p_module_bank
->
i_cache
;
pp_cache
=
p_this
->
p_libvlc
->
p_module_bank
->
pp_cache
;
...
...
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