summaryrefslogtreecommitdiffstats
path: root/stream/cache_file.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-18 00:10:54 +0200
committerwm4 <wm4@nowhere>2015-08-18 00:10:54 +0200
commitcf2fa9d3e5bd6b8ca3e1637080b665e896ea60a0 (patch)
tree1de6ea60ee9f38ad5b7b66d7d15ee7a806a1520b /stream/cache_file.c
parentbf5eac8dd3f142acd0d506407f1ae853ada3c5bc (diff)
downloadmpv-cf2fa9d3e5bd6b8ca3e1637080b665e896ea60a0.tar.bz2
mpv-cf2fa9d3e5bd6b8ca3e1637080b665e896ea60a0.tar.xz
stream: provide a stream_get_size() convenience function
And use it everywhere, instead of retrieving the size manually. Slight simplification.
Diffstat (limited to 'stream/cache_file.c')
-rw-r--r--stream/cache_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/stream/cache_file.c b/stream/cache_file.c
index 94b3f4bda2..901b3f6f3b 100644
--- a/stream/cache_file.c
+++ b/stream/cache_file.c
@@ -66,8 +66,7 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len)
}
// Size of file changes -> invalidate last block
if (s->pos >= p->size - BLOCK_SIZE) {
- int64_t new_size = -1;
- stream_control(s, STREAM_CTRL_GET_SIZE, &new_size);
+ int64_t new_size = stream_get_size(s);
if (p->size >= 0 && new_size != p->size)
set_bit(p, BLOCK_ALIGN(p->size), 0);
p->size = MPMIN(p->max_size, new_size);