mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user