mirror of https://github.com/mpv-player/mpv
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:
parent
1299fbec05
commit
bcf3904a0d
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue