summaryrefslogtreecommitdiffstats
path: root/demux/demux_playlist.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-30 19:30:22 +0100
committerwm4 <wm4@nowhere>2014-11-30 19:30:22 +0100
commit18a621ae26610e5facba9b784425543ce8118c15 (patch)
tree59c73c48c9fa87377be410e44bf9879e106e5523 /demux/demux_playlist.c
parent09e5d7c1e6214529ebe5c5a84d874ba6a160e6a1 (diff)
downloadmpv-18a621ae26610e5facba9b784425543ce8118c15.tar.bz2
mpv-18a621ae26610e5facba9b784425543ce8118c15.tar.xz
demux_playlist: don't ignore last line in m3u
If EOF is reached after reading a line, the EOF flag is set. This was a problem for the m3u code, which checked for EOF _after_ reading a line, which will discard the last line read. Also fix a typo in an unrelated part of the file.
Diffstat (limited to 'demux/demux_playlist.c')
-rw-r--r--demux/demux_playlist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index 905778e058..a15aecad11 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -86,7 +86,7 @@ static int parse_m3u(struct pl_parser *p)
return -1;
if (p->probing)
return 0;
- while (!pl_eof(p)) {
+ while (line.len || !pl_eof(p)) {
if (line.len > 0 && !bstr_startswith0(line, "#"))
pl_add(p, line);
line = bstr_strip(pl_get_line(p));
@@ -110,7 +110,7 @@ static int parse_ref_init(struct pl_parser *p)
"application/vnd.ms.wms-hdr.asfv1", NULL};
bstr burl = bstr0(p->s->url);
if (bstr_eatstart0(&burl, "http://") && check_mimetype(p->s, mmsh_types)) {
- MP_INFO(p, "Redirectiong to mmsh://\n");
+ MP_INFO(p, "Redirecting to mmsh://\n");
playlist_add_file(p->pl, talloc_asprintf(p, "mmsh://%.*s", BSTR_P(burl)));
return 0;
}