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.
This commit is contained in:
wm4 2015-04-21 22:36:46 +02:00
parent 1299fbec05
commit bcf3904a0d
1 changed files with 3 additions and 0 deletions

View File

@ -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);