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_file.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_file.c')
-rw-r--r-- | stream/stream_file.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index 6a46c1c2c7..5d9bfd66b3 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -132,21 +132,6 @@ static int seek(stream_t *s, int64_t newpos) return lseek(p->fd, newpos, SEEK_SET) != (off_t)-1; } -static int control(stream_t *s, int cmd, void *arg) -{ - switch (cmd) { - case STREAM_CTRL_GET_SIZE: { - int64_t size = get_size(s); - if (size >= 0) { - *(int64_t *)arg = size; - return 1; - } - break; - } - } - return STREAM_UNSUPPORTED; -} - static void s_close(stream_t *s) { struct priv *p = s->priv; @@ -343,7 +328,7 @@ static int open_f(stream_t *stream) stream->fast_skip = true; stream->fill_buffer = fill_buffer; stream->write_buffer = write_buffer; - stream->control = control; + stream->get_size = get_size; stream->read_chunk = 64 * 1024; stream->close = s_close; |