From 771199e6d41743aee2c021fd03dac055f14240e0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 May 2014 20:11:15 +0200 Subject: 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. --- demux/demux_playlist.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'demux/demux_playlist.c') diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c index ee82097fc6..f8f763c375 100644 --- a/demux/demux_playlist.c +++ b/demux/demux_playlist.c @@ -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; } -- cgit v1.2.3