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
346350ee
Commit
346350ee
authored
Dec 03, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M3U: fallback to local code page if
UTF-8
fails (close #862)
parent
27bf7df3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
modules/demux/playlist/m3u.c
modules/demux/playlist/m3u.c
+29
-10
No files found.
modules/demux/playlist/m3u.c
View file @
346350ee
...
...
@@ -78,6 +78,29 @@ void E_(Close_M3U)( vlc_object_t *p_this )
free
(
p_demux
->
p_sys
);
}
/* Gruik! */
static
inline
char
*
MaybeFromLocaleDup
(
const
char
*
str
)
{
if
(
str
==
NULL
)
return
NULL
;
return
IsUTF8
(
str
)
?
strdup
(
str
)
:
FromLocaleDup
(
str
);
}
static
inline
void
MaybeFromLocaleRep
(
char
**
str
)
{
char
*
const
orig_str
=
*
str
;
if
((
orig_str
!=
NULL
)
&&
!
IsUTF8
(
orig_str
))
{
*
str
=
FromLocaleDup
(
orig_str
);
free
(
orig_str
);
}
}
static
int
Demux
(
demux_t
*
p_demux
)
{
char
*
psz_line
;
...
...
@@ -86,7 +109,7 @@ static int Demux( demux_t *p_demux )
int
i_parsed_duration
=
0
;
mtime_t
i_duration
=
-
1
;
const
char
**
ppsz_options
=
NULL
;
int
i_options
=
0
,
i
;
int
i_options
=
0
;
vlc_bool_t
b_cleanup
=
VLC_FALSE
;
input_item_t
*
p_input
;
...
...
@@ -128,11 +151,11 @@ static int Demux( demux_t *p_demux )
sizeof
(
"EXTVLCOPT:"
)
-
1
)
)
{
/* VLC Option */
c
onst
c
har
*
psz_option
;
char
*
psz_option
;
psz_parse
+=
sizeof
(
"EXTVLCOPT:"
)
-
1
;
if
(
!*
psz_parse
)
goto
error
;
psz_option
=
strd
up
(
psz_parse
);
psz_option
=
MaybeFromLocaleD
up
(
psz_parse
);
if
(
psz_option
)
INSERT_ELEM
(
ppsz_options
,
i_options
,
i_options
,
psz_option
);
...
...
@@ -148,20 +171,15 @@ static int Demux( demux_t *p_demux )
if
(
!
psz_name
||
!*
psz_name
)
{
/* Use filename as name for relative entries */
psz_name
=
strd
up
(
psz_parse
);
psz_name
=
MaybeFromLocaleD
up
(
psz_parse
);
}
psz_mrl
=
E_
(
ProcessMRL
)(
psz_parse
,
p_demux
->
p_sys
->
psz_prefix
);
MaybeFromLocaleRep
(
&
psz_mrl
);
b_cleanup
=
VLC_TRUE
;
if
(
!
psz_mrl
)
goto
error
;
EnsureUTF8
(
psz_name
);
EnsureUTF8
(
psz_mrl
);
for
(
i
=
0
;
i
<
i_options
;
i
++
)
EnsureUTF8
(
(
char
*
)
ppsz_options
[
i
]
);
p_input
=
input_ItemNewExt
(
p_playlist
,
psz_mrl
,
psz_name
,
i_options
,
ppsz_options
,
i_duration
);
if
(
psz_artist
&&
*
psz_artist
)
...
...
@@ -171,6 +189,7 @@ static int Demux( demux_t *p_demux )
PLAYLIST_APPEND
|
PLAYLIST_SPREPARSE
,
PLAYLIST_END
,
NULL
,
NULL
);
free
(
psz_mrl
);
// XXX Not to be a scare monger, but I suspect options are leaked
}
error:
...
...
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