summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-06 20:11:15 +0200
committerwm4 <wm4@nowhere>2014-05-06 20:11:15 +0200
commit771199e6d41743aee2c021fd03dac055f14240e0 (patch)
tree2f0f724bd79b120f9ebe9271733e6ce5d8d44572 /demux
parent690b5c5161569ac6a93af8ab9c1bc78d5d5b868d (diff)
downloadmpv-771199e6d41743aee2c021fd03dac055f14240e0.tar.bz2
mpv-771199e6d41743aee2c021fd03dac055f14240e0.tar.xz
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.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_playlist.c7
1 files changed, 3 insertions, 4 deletions
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;
}