From 8d6973187126d0ba6c9344c3db01144d0c3fac1e Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Mar 2016 11:43:16 +0200 Subject: cache: fix incorrect EOF condition Don't assume EOF if we didn't try to read anything in the first place. Fixes regressions in particular with low cache sizes, which triggered the other code paths more often. --- stream/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/cache.c b/stream/cache.c index 0ed371806d..874cdf4a8c 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -296,7 +296,8 @@ static void cache_fill(struct priv *s) done: ; bool prev_eof = s->eof; - s->eof = len <= 0; + if (read_attempted) + s->eof = len <= 0; if (!prev_eof && s->eof) { s->eof_pos = stream_tell(s->stream); s->speed_start = 0; -- cgit v1.2.3