From bcf3904a0de2856b73a13d6e45de28afd15e6b6b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Apr 2015 22:36:46 +0200 Subject: cache: exit early on cancellation An approximate measure to make it exit possibly slightly earlier. Relatively speaking, some time will pass between cancellation and the cache actually being requested to exit, so it's good if the cache returns EOF immediately. --- stream/cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stream/cache.c b/stream/cache.c index b7ed76c8fa..0ffa3927be 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -208,6 +208,9 @@ static bool cache_fill(struct priv *s) goto done; } + if (mp_cancel_test(s->cache->cancel)) + goto done; + // number of buffer bytes which should be preserved in backwards direction int64_t back = MPCLAMP(read - s->min_filepos, 0, s->back_size); -- cgit v1.2.3