Commit 56a345ef authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

hls: Don't fail when a STREAM-INF is commented.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9ffcb9c5
...@@ -1034,27 +1034,35 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const ...@@ -1034,27 +1034,35 @@ static int parse_M3U8(stream_t *s, vlc_array_t *streams, uint8_t *buffer, const
err = VLC_ENOMEM; err = VLC_ENOMEM;
else else
{ {
hls_stream_t *hls = NULL; if (*uri == '#')
err = parse_StreamInformation(s, &streams, &hls, line, uri);
free(uri);
/* Download playlist file from server */
uint8_t *buf = NULL;
ssize_t len = read_M3U8_from_url(s, &hls->url, &buf);
if (len < 0)
err = VLC_EGENERIC;
else
{ {
/* Parse HLS m3u8 content. */ msg_Info(s, "Skipping invalid stream-inf: %s", uri);
err = parse_M3U8(s, streams, buf, len); free(uri);
free(buf);
} }
else
if (hls)
{ {
hls->version = version; hls_stream_t *hls = NULL;
if (!p_sys->b_live) err = parse_StreamInformation(s, &streams, &hls, line, uri);
hls->size = hls_GetStreamSize(hls); /* Stream size (approximate) */ free(uri);
/* Download playlist file from server */
uint8_t *buf = NULL;
ssize_t len = read_M3U8_from_url(s, &hls->url, &buf);
if (len < 0)
err = VLC_EGENERIC;
else
{
/* Parse HLS m3u8 content. */
err = parse_M3U8(s, streams, buf, len);
free(buf);
}
if (hls)
{
hls->version = version;
if (!p_sys->b_live)
hls->size = hls_GetStreamSize(hls); /* Stream size (approximate) */
}
} }
} }
p_begin = p_read; p_begin = p_read;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment