summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 16:04:22 +0100
committerwm4 <wm4@nowhere>2019-11-07 22:53:13 +0100
commit6487abde79684ace6e24a127d1f62febf40f0d9b (patch)
tree1b511ae0ca89a244c2a3a3b49760b4ca834064f3 /stream
parente5a9b792ecf08ddbcf3b674de3a00f7a919d1858 (diff)
downloadmpv-6487abde79684ace6e24a127d1f62febf40f0d9b.tar.bz2
mpv-6487abde79684ace6e24a127d1f62febf40f0d9b.tar.xz
stream: remove unused read_chunk field
It was set, but its value was never used. The stream cache used to use it, but it was removed. It controlled how much data it tried to read from the underlying stream at once. The user can now control the buffer size with --stream-buffer-size, which achieves a similar effect, because the stream will in the common case read half of the buffer size at once. In fact, the new default size is 128KB, i.e. 64KB read size, which is as much as stream_file and stream_cb requested by default. stream_memory requested more, but it doesn't matter anyway. Only stream_smb set a larger size with 128KB.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c3
-rw-r--r--stream/stream.h1
-rw-r--r--stream/stream_cb.c1
-rw-r--r--stream/stream_concat.c2
-rw-r--r--stream/stream_file.c1
-rw-r--r--stream/stream_memory.c1
-rw-r--r--stream/stream_smb.c1
7 files changed, 0 insertions, 10 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 7fbc0d3373..31a4f8fb24 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -353,9 +353,6 @@ static int stream_create_instance(const stream_info_t *sinfo,
return r;
}
- if (!s->read_chunk)
- s->read_chunk = 4 * STREAM_BUFFER_SIZE;
-
if (!stream_resize_buffer(s, 0)) {
free_stream(s);
return STREAM_ERROR;
diff --git a/stream/stream.h b/stream/stream.h
index 55db9c1314..8b36d137a7 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -120,7 +120,6 @@ typedef struct stream {
// Close
void (*close)(struct stream *s);
- int read_chunk; // maximum amount of data to read at once to limit latency
int64_t pos;
int eof;
int mode; //STREAM_READ or STREAM_WRITE
diff --git a/stream/stream_cb.c b/stream/stream_cb.c
index c6f33263a3..ba0b3e5da3 100644
--- a/stream/stream_cb.c
+++ b/stream/stream_cb.c
@@ -92,7 +92,6 @@ static int open_cb(stream_t *stream)
stream->fast_skip = true;
stream->fill_buffer = fill_buffer;
stream->get_size = get_size;
- stream->read_chunk = 64 * 1024;
stream->close = s_close;
if (p->info.cancel_fn && stream->cancel) {
diff --git a/stream/stream_concat.c b/stream/stream_concat.c
index f45bd6f743..a10fee7912 100644
--- a/stream/stream_concat.c
+++ b/stream/stream_concat.c
@@ -107,8 +107,6 @@ static int open2(struct stream *stream, struct stream_open_args *args)
for (int n = 0; n < list->num_streams; n++) {
struct stream *sub = list->streams[n];
- stream->read_chunk = MPMAX(stream->read_chunk, sub->read_chunk);
-
int64_t size = stream_get_size(sub);
if (n != list->num_streams - 1 && size < 0) {
MP_WARN(stream, "Sub stream %d has unknown size.\n", n);
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 5d9bfd66b3..1ad9a5c7f5 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -329,7 +329,6 @@ static int open_f(stream_t *stream)
stream->fill_buffer = fill_buffer;
stream->write_buffer = write_buffer;
stream->get_size = get_size;
- stream->read_chunk = 64 * 1024;
stream->close = s_close;
if (check_stream_network(p->fd))
diff --git a/stream/stream_memory.c b/stream/stream_memory.c
index 5acd05dfea..7b1092a76d 100644
--- a/stream/stream_memory.c
+++ b/stream/stream_memory.c
@@ -50,7 +50,6 @@ static int open2(stream_t *stream, struct stream_open_args *args)
stream->seek = seek;
stream->seekable = true;
stream->get_size = get_size;
- stream->read_chunk = 1024 * 1024;
struct priv *p = talloc_zero(stream, struct priv);
stream->priv = p;
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index a87150a838..33928d4e61 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -141,7 +141,6 @@ static int open_f (stream_t *stream)
stream->write_buffer = write_buffer;
stream->close = close_f;
stream->get_size = get_size;
- stream->read_chunk = 128 * 1024;
stream->streaming = true;
return STREAM_OK;