diff options
author | wm4 <wm4@nowhere> | 2019-11-07 15:54:34 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-07 22:53:13 +0100 |
commit | e5a9b792ecf08ddbcf3b674de3a00f7a919d1858 (patch) | |
tree | ead751b12d006d13f138867324b62dda62b8e77b /stream/stream_libarchive.c | |
parent | ca75fedaf4dea19986159f1caa5ab9ebc202f9d4 (diff) | |
download | mpv-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_libarchive.c')
-rw-r--r-- | stream/stream_libarchive.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index 0e136c175d..ab8fda0f34 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -468,17 +468,10 @@ static void archive_entry_close(stream_t *s) free_stream(p->src); } -static int archive_entry_control(stream_t *s, int cmd, void *arg) +static int64_t archive_entry_get_size(stream_t *s) { struct priv *p = s->priv; - switch (cmd) { - case STREAM_CTRL_GET_SIZE: - if (p->entry_size < 0) - break; - *(int64_t *)arg = p->entry_size; - return STREAM_OK; - } - return STREAM_UNSUPPORTED; + return p->entry_size; } static int archive_entry_open(stream_t *stream) @@ -514,7 +507,7 @@ static int archive_entry_open(stream_t *stream) stream->seekable = true; } stream->close = archive_entry_close; - stream->control = archive_entry_control; + stream->get_size = archive_entry_get_size; stream->streaming = true; return STREAM_OK; |