From cf2fa9d3e5bd6b8ca3e1637080b665e896ea60a0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 18 Aug 2015 00:10:54 +0200 Subject: stream: provide a stream_get_size() convenience function And use it everywhere, instead of retrieving the size manually. Slight simplification. --- stream/cache_file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'stream/cache_file.c') 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); -- cgit v1.2.3