summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-04-05 23:00:12 +0200
committerJan Ekström <jeebjp@gmail.com>2021-04-08 23:47:35 +0300
commit5117fa70afc0431e57231e216474a1f530094fd0 (patch)
treeb1d0ad44f4184b7eee3e1392d0c896c1bac6761f
parent6be613c178d96c60ca0ae08a32946a5c4ce02989 (diff)
downloadmpv-5117fa70afc0431e57231e216474a1f530094fd0.tar.bz2
mpv-5117fa70afc0431e57231e216474a1f530094fd0.tar.xz
stream: turn stream_info.open2's args argument const
So nobody comes up with the "smart" idea to modify those again.
-rw-r--r--stream/stream.h2
-rw-r--r--stream/stream_concat.c2
-rw-r--r--stream/stream_file.c2
-rw-r--r--stream/stream_memory.c2
-rw-r--r--stream/stream_slice.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/stream/stream.h b/stream/stream.h
index 2116fdde27..423ba12d91 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -109,7 +109,7 @@ typedef struct stream_info_st {
// opts is set from ->opts
int (*open)(struct stream *st);
// Alternative to open(). Only either open() or open2() can be set.
- int (*open2)(struct stream *st, struct stream_open_args *args);
+ int (*open2)(struct stream *st, const struct stream_open_args *args);
const char *const *protocols;
bool can_write; // correctly checks for READ/WRITE modes
bool local_fs; // supports STREAM_LOCAL_FS_ONLY
diff --git a/stream/stream_concat.c b/stream/stream_concat.c
index 21f04f9d62..d06bd4a782 100644
--- a/stream/stream_concat.c
+++ b/stream/stream_concat.c
@@ -99,7 +99,7 @@ static int combine_origin(int cur, int new)
return new; // including cur==0
}
-static int open2(struct stream *stream, struct stream_open_args *args)
+static int open2(struct stream *stream, const struct stream_open_args *args)
{
struct priv *p = talloc_zero(stream, struct priv);
stream->priv = p;
diff --git a/stream/stream_file.c b/stream/stream_file.c
index d649ff4bdf..612d4bee38 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -246,7 +246,7 @@ static bool check_stream_network(int fd)
}
#endif
-static int open_f(stream_t *stream, struct stream_open_args *args)
+static int open_f(stream_t *stream, const struct stream_open_args *args)
{
struct priv *p = talloc_ptrtype(stream, p);
*p = (struct priv) {
diff --git a/stream/stream_memory.c b/stream/stream_memory.c
index 7383ff4d6f..e4696a73ad 100644
--- a/stream/stream_memory.c
+++ b/stream/stream_memory.c
@@ -44,7 +44,7 @@ static int64_t get_size(stream_t *s)
return p->data.len;
}
-static int open2(stream_t *stream, struct stream_open_args *args)
+static int open2(stream_t *stream, const struct stream_open_args *args)
{
stream->fill_buffer = fill_buffer;
stream->seek = seek;
diff --git a/stream/stream_slice.c b/stream/stream_slice.c
index 8bf80943eb..c0dbeeb2af 100644
--- a/stream/stream_slice.c
+++ b/stream/stream_slice.c
@@ -136,7 +136,7 @@ static int parse_slice_range(stream_t *stream)
return STREAM_OK;
}
-static int open2(struct stream *stream, struct stream_open_args *args)
+static int open2(struct stream *stream, const struct stream_open_args *args)
{
struct priv *p = talloc_zero(stream, struct priv);
stream->priv = p;