demux_playlist: recognize m3u8 as playlist extension

Whatever. As mentioned in #3154.
This commit is contained in:
wm4 2016-05-17 18:17:46 +02:00
parent a02d77ba0d
commit 26b6d74484
1 changed files with 9 additions and 2 deletions

View File

@ -106,14 +106,21 @@ static int parse_m3u(struct pl_parser *p)
if (p->check_level == DEMUX_CHECK_UNSAFE) {
char *ext = mp_splitext(p->real_stream->url, NULL);
bstr data = stream_peek(p->real_stream, PROBE_SIZE);
if (ext && !strcmp(ext, "m3u") && data.len > 10 && maybe_text(data))
if (ext && data.len > 10 && maybe_text(data)) {
const char *exts[] = {"m3u", "m3u8", NULL};
for (int n = 0; exts[n]; n++) {
if (strcasecmp(ext, exts[n]) == 0)
goto ok;
}
}
}
return -1;
}
ok:
if (p->probing)
return 0;
char *title = NULL;
while (line.len || !pl_eof(p)) {
if (bstr_eatstart0(&line, "#EXTINF:")) {