From e5a9b792ecf08ddbcf3b674de3a00f7a919d1858 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 Nov 2019 15:54:34 +0100 Subject: stream: replace STREAM_CTRL_GET_SIZE with a proper entrypoint This is overlay convoluted as a stream control, and important enough to warrant "first class" functionality. --- stream/stream.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 1f77a5dd1e..7fbc0d3373 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -710,10 +710,7 @@ int stream_control(stream_t *s, int cmd, void *arg) // Return the current size of the stream, or a negative value if unknown. int64_t stream_get_size(stream_t *s) { - int64_t size = -1; - if (stream_control(s, STREAM_CTRL_GET_SIZE, &size) != STREAM_OK) - size = -1; - return size; + return s->get_size ? s->get_size(s) : -1; } void free_stream(stream_t *s) -- cgit v1.2.3