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
9d88d50a
Commit
9d88d50a
authored
Oct 31, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
M3U: add support for .m3u8 files (Apple invention)
parent
7eb4785e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
modules/demux/playlist/m3u.c
modules/demux/playlist/m3u.c
+20
-7
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.c
+1
-0
No files found.
modules/demux/playlist/m3u.c
View file @
9d88d50a
...
...
@@ -39,6 +39,7 @@
struct
demux_sys_t
{
char
*
psz_prefix
;
char
*
(
*
pf_dup
)
(
const
char
*
);
};
/*****************************************************************************
...
...
@@ -57,14 +58,25 @@ int Import_M3U( vlc_object_t *p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
const
uint8_t
*
p_peek
;
CHECK_PEEK
(
p_peek
,
8
);
char
*
(
*
pf_dup
)
(
const
char
*
);
if
(
!
(
POKE
(
p_peek
,
"#EXTM3U"
,
7
)
||
POKE
(
p_peek
,
"RTSPtext"
,
8
)
||
demux_IsPathExtension
(
p_demux
,
".m3u"
)
||
demux_IsPathExtension
(
p_demux
,
".vlc"
)
||
demux_IsForced
(
p_demux
,
"m3u"
)
||
ContainsURL
(
p_demux
)
)
)
if
(
POKE
(
p_peek
,
"RTSPtext"
,
8
)
/* QuickTime */
||
demux_IsPathExtension
(
p_demux
,
".m3u8"
)
||
demux_IsForced
(
p_demux
,
"m3u8"
)
)
pf_dup
=
strdup
;
/* UTF-8 */
else
if
(
POKE
(
p_peek
,
"#EXTM3U"
,
7
)
||
demux_IsPathExtension
(
p_demux
,
".m3u"
)
||
demux_IsPathExtension
(
p_demux
,
".vlc"
)
||
demux_IsForced
(
p_demux
,
"m3u"
)
||
ContainsURL
(
p_demux
)
)
pf_dup
=
FromLocaleDup
;
/* locale character set (?) */
else
return
VLC_EGENERIC
;
STANDARD_DEMUX_INIT_MSG
(
"found valid M3U playlist"
);
p_demux
->
p_sys
->
psz_prefix
=
FindPrefix
(
p_demux
);
p_demux
->
p_sys
->
pf_dup
=
pf_dup
;
return
VLC_SUCCESS
;
}
...
...
@@ -122,6 +134,7 @@ static int Demux( demux_t *p_demux )
int
i_parsed_duration
=
0
;
mtime_t
i_duration
=
-
1
;
const
char
**
ppsz_options
=
NULL
;
char
*
(
*
pf_dup
)
(
const
char
*
)
=
p_demux
->
p_sys
->
pf_dup
;
int
i_options
=
0
;
bool
b_cleanup
=
false
;
input_item_t
*
p_input
;
...
...
@@ -156,9 +169,9 @@ static int Demux( demux_t *p_demux )
if
(
i_parsed_duration
>=
0
)
i_duration
=
i_parsed_duration
*
INT64_C
(
1000000
);
if
(
psz_name
)
psz_name
=
FromLocaleD
up
(
psz_name
);
psz_name
=
pf_d
up
(
psz_name
);
if
(
psz_artist
)
psz_artist
=
FromLocaleD
up
(
psz_artist
);
psz_artist
=
pf_d
up
(
psz_artist
);
}
else
if
(
!
strncasecmp
(
psz_parse
,
"EXTVLCOPT:"
,
sizeof
(
"EXTVLCOPT:"
)
-
1
)
)
...
...
@@ -168,7 +181,7 @@ static int Demux( demux_t *p_demux )
psz_parse
+=
sizeof
(
"EXTVLCOPT:"
)
-
1
;
if
(
!*
psz_parse
)
goto
error
;
psz_option
=
FromLocaleD
up
(
psz_parse
);
psz_option
=
pf_d
up
(
psz_parse
);
if
(
psz_option
)
INSERT_ELEM
(
ppsz_options
,
i_options
,
i_options
,
psz_option
);
...
...
@@ -182,7 +195,7 @@ static int Demux( demux_t *p_demux )
{
char
*
psz_mrl
;
psz_parse
=
FromLocale
(
psz_parse
);
psz_parse
=
pf_dup
(
psz_parse
);
if
(
!
psz_name
&&
psz_parse
)
/* Use filename as name for relative entries */
psz_name
=
strdup
(
psz_parse
);
...
...
modules/demux/playlist/playlist.c
View file @
9d88d50a
...
...
@@ -69,6 +69,7 @@ vlc_module_begin ()
set_description
(
N_
(
"M3U playlist import"
)
)
add_shortcut
(
"playlist"
)
add_shortcut
(
"m3u"
)
add_shortcut
(
"m3u8"
)
add_shortcut
(
"m3u-open"
)
set_capability
(
"demux"
,
10
)
set_callbacks
(
Import_M3U
,
Close_M3U
)
...
...
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