Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5a7f4600
Commit
5a7f4600
authored
Jul 06, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter/httplive.c: Also check for empty lines.
Do not treat an empty line as a HLS segment.
parent
1ce738d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
modules/stream_filter/httplive.c
modules/stream_filter/httplive.c
+38
-2
No files found.
modules/stream_filter/httplive.c
View file @
5a7f4600
...
...
@@ -138,6 +138,7 @@ static int Control(stream_t *, int i_query, va_list);
static
ssize_t
read_M3U8
(
stream_t
*
s
,
vlc_url_t
*
url
,
uint8_t
**
buffer
);
static
ssize_t
ReadM3U8
(
stream_t
*
s
,
uint8_t
**
buffer
);
static
char
*
ReadLine
(
uint8_t
*
buffer
,
uint8_t
**
pos
,
size_t
len
);
static
char
*
SkipWhiteSpace
(
char
*
buffer
,
const
size_t
len
);
static
int
hls_Download
(
stream_t
*
s
,
segment_t
*
segment
);
...
...
@@ -940,9 +941,16 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const
err
=
parse_EndList
(
s
,
hls
);
else
if
(
strncmp
(
line
,
"#"
,
1
)
!=
0
)
{
char
*
tmp
=
SkipWhiteSpace
(
line
,
strlen
(
line
));
if
(
tmp
)
{
free
(
line
);
line
=
tmp
;
err
=
parse_AddSegment
(
s
,
hls
,
segment_duration
,
line
);
segment_duration
=
-
1
;
/* reset duration */
}
else
err
=
VLC_SUCCESS
;
}
free
(
line
);
line
=
NULL
;
...
...
@@ -1519,6 +1527,34 @@ static char *ReadLine(uint8_t *buffer, uint8_t **pos, const size_t len)
return
line
;
}
static
char
*
SkipWhiteSpace
(
char
*
buffer
,
const
size_t
len
)
{
assert
(
buffer
);
char
*
line
=
NULL
;
uint8_t
*
begin
=
buffer
;
uint8_t
*
p
=
begin
;
uint8_t
*
end
=
p
+
len
;
while
(
p
<
end
)
{
if
((
*
p
!=
'\t'
)
||
(
*
p
!=
' '
)
||
(
*
p
!=
'\0'
))
break
;
p
++
;
}
/* copy line excluding '\t', ' ' or '\0' */
line
=
strndup
((
char
*
)
begin
,
p
-
begin
);
if
(
*
p
!=
'\0'
)
{
/* next pass start after '\t' or ' ' */
p
++
;
}
return
line
;
}
/****************************************************************************
* Open
****************************************************************************/
...
...
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