mirror of https://github.com/mpv-player/mpv
stream: turn stream_info.open2's args argument const
So nobody comes up with the "smart" idea to modify those again.
This commit is contained in:
parent
6be613c178
commit
5117fa70af
|
@ -109,7 +109,7 @@ typedef struct stream_info_st {
|
||||||
// opts is set from ->opts
|
// opts is set from ->opts
|
||||||
int (*open)(struct stream *st);
|
int (*open)(struct stream *st);
|
||||||
// Alternative to open(). Only either open() or open2() can be set.
|
// 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;
|
const char *const *protocols;
|
||||||
bool can_write; // correctly checks for READ/WRITE modes
|
bool can_write; // correctly checks for READ/WRITE modes
|
||||||
bool local_fs; // supports STREAM_LOCAL_FS_ONLY
|
bool local_fs; // supports STREAM_LOCAL_FS_ONLY
|
||||||
|
|
|
@ -99,7 +99,7 @@ static int combine_origin(int cur, int new)
|
||||||
return new; // including cur==0
|
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);
|
struct priv *p = talloc_zero(stream, struct priv);
|
||||||
stream->priv = p;
|
stream->priv = p;
|
||||||
|
|
|
@ -246,7 +246,7 @@ static bool check_stream_network(int fd)
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
struct priv *p = talloc_ptrtype(stream, p);
|
||||||
*p = (struct priv) {
|
*p = (struct priv) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int64_t get_size(stream_t *s)
|
||||||
return p->data.len;
|
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->fill_buffer = fill_buffer;
|
||||||
stream->seek = seek;
|
stream->seek = seek;
|
||||||
|
|
|
@ -136,7 +136,7 @@ static int parse_slice_range(stream_t *stream)
|
||||||
return STREAM_OK;
|
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);
|
struct priv *p = talloc_zero(stream, struct priv);
|
||||||
stream->priv = p;
|
stream->priv = p;
|
||||||
|
|
Loading…
Reference in New Issue