diff options
author | wm4 <wm4@nowhere> | 2014-11-30 19:30:22 +0100 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-12-01 15:40:57 +0100 |
commit | 5ecb381d78b40b0e5d84e0fcd339261bd34973da (patch) | |
tree | 1b7b2a05455e78b3dc34a22840e7aa54a75db537 /demux/demux_playlist.c | |
parent | 17f1332955449f0037ebe5fb0694c6add5971432 (diff) | |
download | mpv-5ecb381d78b40b0e5d84e0fcd339261bd34973da.tar.bz2 mpv-5ecb381d78b40b0e5d84e0fcd339261bd34973da.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.c | 4 |
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; } |