demux_playlist: don't require header for m3u

Because the http playlist URL I had for testing claimed to be m3u by
file extension and mime type, but didn't have the header.

Note that this actually changes behavior only in the case the format is
detected by mime type. Then p->force will be set before calling the
parser, and the header becomes optional.
This commit is contained in:
wm4 2014-05-06 20:11:15 +02:00
parent 690b5c5161
commit 771199e6d4
1 changed files with 3 additions and 4 deletions

View File

@ -69,15 +69,14 @@ static bool pl_eof(struct pl_parser *p)
static int parse_m3u(struct pl_parser *p)
{
bstr line = bstr_strip(pl_get_line(p));
if (!bstr_equals0(line, "#EXTM3U"))
if (!p->force && !bstr_equals0(line, "#EXTM3U"))
return -1;
if (p->probing)
return 0;
while (!pl_eof(p)) {
if (line.len > 0 && !bstr_startswith0(line, "#"))
pl_add(p, line);
line = bstr_strip(pl_get_line(p));
if (line.len == 0 || bstr_startswith0(line, "#"))
continue;
pl_add(p, line);
}
return 0;
}