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
0106a8b6
Commit
0106a8b6
authored
Aug 22, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m3u: rewrite probing (fix #9237)
parent
9066dd9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
modules/demux/playlist/m3u.c
modules/demux/playlist/m3u.c
+27
-13
No files found.
modules/demux/playlist/m3u.c
View file @
0106a8b6
...
...
@@ -67,30 +67,44 @@ 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
*
)
;
char
*
(
*
pf_dup
)
(
const
char
*
)
=
GuessEncoding
;
int
offset
=
0
;
if
(
POKE
(
p_peek
,
"
\xef\xbb\xbf
"
,
3
)
)
/* BOM at start */
if
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
3
)
==
3
&&
!
memcmp
(
p_peek
,
"
\xef\xbb\xbf
"
,
3
)
)
{
pf_dup
=
CheckUnicode
;
/* UTF-8 */
stream_Seek
(
p_demux
->
s
,
3
)
;
pf_dup
=
CheckUnicode
;
/* UTF-8
Byte Order Mark
*/
offset
=
3
;
}
else
if
(
POKE
(
p_peek
,
"RTSPtext"
,
8
)
/* QuickTime */
||
demux_IsPathExtension
(
p_demux
,
".m3u8"
)
if
(
demux_IsPathExtension
(
p_demux
,
".m3u8"
)
||
demux_IsForced
(
p_demux
,
"m3u8"
)
||
CheckContentType
(
p_demux
->
s
,
"application/vnd.apple.mpegurl"
)
)
pf_dup
=
CheckUnicode
;
/* UTF-8 */
pf_dup
=
CheckUnicode
;
/* UTF-8
file type
*/
else
if
(
POKE
(
p_peek
,
"#EXTM3U"
,
7
)
||
demux_IsPathExtension
(
p_demux
,
".m3u"
)
if
(
demux_IsPathExtension
(
p_demux
,
".m3u"
)
||
demux_IsPathExtension
(
p_demux
,
".vlc"
)
||
demux_IsForced
(
p_demux
,
"m3u"
)
||
ContainsURL
(
p_demux
)
||
CheckContentType
(
p_demux
->
s
,
"audio/x-mpegurl"
)
)
pf_dup
=
GuessEncoding
;
;
/* Guess encoding */
else
return
VLC_EGENERIC
;
{
if
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
8
+
offset
)
<
(
8
+
offset
)
)
return
VLC_EGENERIC
;
p_peek
+=
offset
;
if
(
!
memcmp
(
p_peek
,
"RTSPtext"
,
8
)
)
/* QuickTime */
pf_dup
=
CheckUnicode
;
/* UTF-8 */
else
if
(
!
memcmp
(
p_peek
,
"#EXTM3U"
,
7
)
)
;
/* Guess encoding */
else
return
VLC_EGENERIC
;
}
stream_Seek
(
p_demux
->
s
,
offset
);
STANDARD_DEMUX_INIT_MSG
(
"found valid M3U playlist"
);
p_demux
->
p_sys
->
psz_prefix
=
FindPrefix
(
p_demux
);
...
...
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