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
3e6aa513
Commit
3e6aa513
authored
Feb 28, 2006
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VLC stream functions to load vlm configs. Refs #567
parent
7e7d587a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
src/misc/vlm.c
src/misc/vlm.c
+13
-11
No files found.
src/misc/vlm.c
View file @
3e6aa513
...
...
@@ -215,40 +215,42 @@ int vlm_Save( vlm_t *p_vlm, const char *psz_file )
*****************************************************************************/
int
vlm_Load
(
vlm_t
*
p_vlm
,
const
char
*
psz_file
)
{
FILE
*
file
;
stream_t
*
p_stream
;
int64_t
i_size
;
char
*
psz_buffer
;
if
(
!
p_vlm
||
!
psz_file
)
return
1
;
file
=
utf8_fopen
(
psz_file
,
"r"
);
if
(
file
==
NULL
)
return
1
;
p_stream
=
stream_UrlNew
(
p_vlm
,
psz_file
);
if
(
p_stream
==
NULL
)
return
1
;
if
(
fseek
(
file
,
0
,
SEEK_END
)
!=
0
)
if
(
stream_Seek
(
p_stream
,
0
)
!=
0
)
{
fclose
(
file
);
stream_Delete
(
p_stream
);
return
2
;
}
i_size
=
ftell
(
file
);
fseek
(
file
,
0
,
SEEK_SET
);
i_size
=
stream_Size
(
p_stream
);
psz_buffer
=
malloc
(
i_size
+
1
);
if
(
!
psz_buffer
)
{
fclose
(
file
);
stream_Delete
(
p_stream
);
return
2
;
}
fread
(
psz_buffer
,
1
,
i_size
,
file
);
stream_Read
(
p_stream
,
psz_buffer
,
i_size
);
psz_buffer
[
i_size
]
=
'\0'
;
stream_Delete
(
p_stream
);
if
(
Load
(
p_vlm
,
psz_buffer
)
)
{
fclose
(
file
);
free
(
psz_buffer
);
return
3
;
}
free
(
psz_buffer
);
fclose
(
file
);
return
0
;
}
...
...
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