summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-10 14:10:44 +0200
committerwm4 <wm4@nowhere>2015-09-10 14:15:45 +0200
commit2492b5f1198161a04b046554df79390eb312ca5c (patch)
treedf27c35d28d6ae49c439e2322a15310e7d124bc9 /stream
parentd3bd5c9541af3618130f5269005f7b6fdf8e209a (diff)
downloadmpv-2492b5f1198161a04b046554df79390eb312ca5c.tar.bz2
mpv-2492b5f1198161a04b046554df79390eb312ca5c.tar.xz
cache: do not include backbuffer size in total stream cache size
This causes weirdness with the "cache-size" property and option. Only the read handler of the property included the backbuffer, while all others did not. Make it consistent, and subtract the backbuffer size from the cache size. Fixes #2305.
Diffstat (limited to 'stream')
-rw-r--r--stream/cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/cache.c b/stream/cache.c
index 43b7eba329..c4eaa6e261 100644
--- a/stream/cache.c
+++ b/stream/cache.c
@@ -367,7 +367,7 @@ static int cache_get_cached_control(stream_t *cache, int cmd, void *arg)
struct priv *s = cache->priv;
switch (cmd) {
case STREAM_CTRL_GET_CACHE_SIZE:
- *(int64_t *)arg = s->buffer_size;
+ *(int64_t *)arg = s->buffer_size - s->back_size;
return STREAM_OK;
case STREAM_CTRL_GET_CACHE_FILL:
*(int64_t *)arg = s->max_filepos - s->read_filepos;