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
7cc97eda
Commit
7cc97eda
authored
Aug 13, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove file size from plugin cache
This avoids seeking. This data was not useful.
parent
48ead28e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
30 deletions
+2
-30
src/modules/cache.c
src/modules/cache.c
+2
-30
No files found.
src/modules/cache.c
View file @
7cc97eda
...
...
@@ -94,7 +94,7 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t ***r )
int
i_size
,
i_read
;
char
p_cachestring
[
sizeof
(
CACHE_STRING
)];
size_t
i_cache
;
int32_t
i_
file_size
,
i_
marker
;
int32_t
i_marker
;
assert
(
dir
!=
NULL
);
...
...
@@ -114,26 +114,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t ***r )
}
free
(
psz_filename
);
/* Check the file size */
i_read
=
fread
(
&
i_file_size
,
1
,
sizeof
(
i_file_size
),
file
);
if
(
i_read
!=
sizeof
(
i_file_size
)
)
{
msg_Warn
(
p_this
,
"This doesn't look like a valid plugins cache "
"(too short)"
);
fclose
(
file
);
return
0
;
}
fseek
(
file
,
0
,
SEEK_END
);
if
(
ftell
(
file
)
!=
i_file_size
)
{
msg_Warn
(
p_this
,
"This doesn't look like a valid plugins cache "
"(corrupted size)"
);
fclose
(
file
);
return
0
;
}
fseek
(
file
,
sizeof
(
i_file_size
),
SEEK_SET
);
/* Check the file is a plugins cache */
i_size
=
sizeof
(
CACHE_STRING
)
-
1
;
i_read
=
fread
(
p_cachestring
,
1
,
i_size
,
file
);
...
...
@@ -472,10 +452,6 @@ static int CacheSaveBank (FILE *file, module_cache_t *const *pp_cache,
{
uint32_t
i_file_size
=
0
;
/* Empty space for file size */
if
(
fwrite
(
&
i_file_size
,
sizeof
(
i_file_size
),
1
,
file
)
!=
1
)
goto
error
;
/* Contains version number */
if
(
fputs
(
CACHE_STRING
,
file
)
==
EOF
)
goto
error
;
...
...
@@ -544,11 +520,7 @@ static int CacheSaveBank (FILE *file, module_cache_t *const *pp_cache,
goto
error
;
}
/* Fill-up file size */
i_file_size
=
ftell
(
file
);
fseek
(
file
,
0
,
SEEK_SET
);
if
(
fwrite
(
&
i_file_size
,
sizeof
(
i_file_size
),
1
,
file
)
!=
1
||
fflush
(
file
))
/* flush libc buffers */
if
(
fflush
(
file
))
/* flush libc buffers */
goto
error
;
return
0
;
/* success! */
...
...
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