summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-15 12:10:01 +0100
committerwm4 <wm4@nowhere>2019-11-15 12:10:01 +0100
commit8d4e012bfa622c2ec0cb9972c49c51f525edb744 (patch)
tree828b64d24d74fec5e89c9276e66a71b03e2dd40d
parent9efdb0368eaed754f690dc61cb5d8592d3438830 (diff)
downloadmpv-8d4e012bfa622c2ec0cb9972c49c51f525edb744.tar.bz2
mpv-8d4e012bfa622c2ec0cb9972c49c51f525edb744.tar.xz
demux_playlist: fix previous commit
This just froze, due to obvious stupidity (I forgot to deal with all semantic changes done to the the former stream_skip()). Fixes: ac7f67b3f23
-rw-r--r--demux/demux_playlist.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index b51edad86c..00db544b30 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -99,7 +99,7 @@ static int read_characters(stream_t *s, uint8_t *dst, int dstsize, int utf16)
if (len > dstsize)
return -1; // line too long
memcpy(dst, buf, len);
- stream_seek_skip(s, len);
+ stream_seek_skip(s, stream_tell(s) + len);
return len;
}
}
@@ -119,7 +119,6 @@ static char *read_line(stream_t *s, char *mem, int max, int utf16)
int l = read_characters(s, &mem[read], max - read - 1, utf16);
if (l < 0 || memchr(&mem[read], '\0', l)) {
MP_WARN(s, "error reading line\n");
- s->eof = false;
return NULL;
}
read += l;
@@ -127,7 +126,7 @@ static char *read_line(stream_t *s, char *mem, int max, int utf16)
break;
}
mem[read] = '\0';
- if (s->eof && read == 0) // legitimate EOF
+ if (!stream_read_peek(s, &(char){0}, 1) && read == 0) // legitimate EOF
return NULL;
return mem;
}