summaryrefslogtreecommitdiffstats
path: root/stream/stream.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 15:54:34 +0100
committerwm4 <wm4@nowhere>2019-11-07 22:53:13 +0100
commite5a9b792ecf08ddbcf3b674de3a00f7a919d1858 (patch)
treeead751b12d006d13f138867324b62dda62b8e77b /stream/stream.c
parentca75fedaf4dea19986159f1caa5ab9ebc202f9d4 (diff)
downloadmpv-e5a9b792ecf08ddbcf3b674de3a00f7a919d1858.tar.bz2
mpv-e5a9b792ecf08ddbcf3b674de3a00f7a919d1858.tar.xz
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.
Diffstat (limited to 'stream/stream.c')
-rw-r--r--stream/stream.c5
1 files changed, 1 insertions, 4 deletions
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)