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.
This commit is contained in:
wm4 2014-11-30 19:30:22 +01:00
parent 09e5d7c1e6
commit 18a621ae26
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ static int parse_m3u(struct pl_parser *p)
return -1; return -1;
if (p->probing) if (p->probing)
return 0; return 0;
while (!pl_eof(p)) { while (line.len || !pl_eof(p)) {
if (line.len > 0 && !bstr_startswith0(line, "#")) if (line.len > 0 && !bstr_startswith0(line, "#"))
pl_add(p, line); pl_add(p, line);
line = bstr_strip(pl_get_line(p)); 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}; "application/vnd.ms.wms-hdr.asfv1", NULL};
bstr burl = bstr0(p->s->url); bstr burl = bstr0(p->s->url);
if (bstr_eatstart0(&burl, "http://") && check_mimetype(p->s, mmsh_types)) { 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))); playlist_add_file(p->pl, talloc_asprintf(p, "mmsh://%.*s", BSTR_P(burl)));
return 0; return 0;
} }