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
0e3e2b84
Commit
0e3e2b84
authored
May 30, 2012
by
Konstantin Pavlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m3u: Check Content-type if available.
parent
75a167f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
modules/demux/playlist/m3u.c
modules/demux/playlist/m3u.c
+16
-2
No files found.
modules/demux/playlist/m3u.c
View file @
0e3e2b84
...
...
@@ -48,6 +48,7 @@ struct demux_sys_t
static
int
Demux
(
demux_t
*
p_demux
);
static
void
parseEXTINF
(
char
*
psz_string
,
char
**
ppsz_artist
,
char
**
ppsz_name
,
int
*
pi_duration
);
static
bool
ContainsURL
(
demux_t
*
p_demux
);
static
bool
CheckContentType
(
stream_t
*
p_stream
,
const
char
*
psz_ctype
);
static
char
*
GuessEncoding
(
const
char
*
str
)
{
...
...
@@ -72,14 +73,16 @@ int Import_M3U( vlc_object_t *p_this )
if
(
POKE
(
p_peek
,
"RTSPtext"
,
8
)
/* QuickTime */
||
POKE
(
p_peek
,
"
\xef\xbb\xbf
"
"#EXTM3U"
,
10
)
/* BOM at start */
||
demux_IsPathExtension
(
p_demux
,
".m3u8"
)
||
demux_IsForced
(
p_demux
,
"m3u8"
)
)
||
demux_IsForced
(
p_demux
,
"m3u8"
)
||
CheckContentType
(
p_demux
->
s
,
"application/vnd.apple.mpegurl"
)
)
pf_dup
=
CheckUnicode
;
/* 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
)
)
||
ContainsURL
(
p_demux
)
||
CheckContentType
(
p_demux
->
s
,
"audio/x-mpegurl"
)
)
pf_dup
=
GuessEncoding
;
else
return
VLC_EGENERIC
;
...
...
@@ -125,6 +128,17 @@ static bool ContainsURL( demux_t *p_demux )
return
false
;
}
static
bool
CheckContentType
(
stream_t
*
p_stream
,
const
char
*
psz_ctype
)
{
char
*
psz_check
=
stream_ContentType
(
p_stream
);
if
(
!
psz_check
)
return
false
;
int
i_res
=
strncasecmp
(
psz_check
,
psz_ctype
,
strlen
(
psz_check
)
);
free
(
psz_check
);
return
(
i_res
==
0
)
?
true
:
false
;
}
/*****************************************************************************
* Deactivate: frees unused data
*****************************************************************************/
...
...
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