summaryrefslogtreecommitdiffstats
path: root/stream/stream_avdevice.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-25 22:49:27 +0200
committerwm4 <wm4@nowhere>2013-08-26 10:09:45 +0200
commit971e8456fc36eb36213c60ab57828aec8640819b (patch)
tree7384dcb71d7a5d70b13cd351912c21c09f78d909 /stream/stream_avdevice.c
parent8be9c49fcd8b23463199036eda5fc290ded6d078 (diff)
downloadmpv-971e8456fc36eb36213c60ab57828aec8640819b.tar.bz2
mpv-971e8456fc36eb36213c60ab57828aec8640819b.tar.xz
stream: fix url_options field, make protocols field not fixed length
The way the url_options field was handled was not entirely sane: it's actually a flexible array member, so it points to garbage for streams which do not initialize this member (it just points to the data right after the struct, which is garbage in theory and practice). This was not actually a problem, since the field is only used if priv_size is set (due to how this stuff is used). But it doesn't allow setting priv_size only, which might be useful in some cases. Also, make the protocols array not a fixed size array. Most stream implementations have only 1 protocol prefix, but stream_lavf.c has over 10 (whitelists ffmpeg protocols). The high size of the fixed size protocol array wastes space, and it is _still_ annoying to add new prefixes to stream_lavf (have to bump the maximum length), so make it arbitrary length. The two changes (plus some more cosmetic changes) arte conflated into one, because it was annoying going over all the stream implementations.
Diffstat (limited to 'stream/stream_avdevice.c')
-rw-r--r--stream/stream_avdevice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/stream_avdevice.c b/stream/stream_avdevice.c
index e1da3b2958..5e8aefd018 100644
--- a/stream/stream_avdevice.c
+++ b/stream/stream_avdevice.c
@@ -34,5 +34,5 @@ static int open_f(stream_t *stream, int mode)
const stream_info_t stream_info_avdevice = {
.name = "avdevice",
.open = open_f,
- .protocols = { "avdevice", "av", NULL },
+ .protocols = (const char*[]){ "avdevice", "av", NULL },
};