path: root/stream/stream_mf.c
diff options
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_mf.c
parent8be9c49fcd8b23463199036eda5fc290ded6d078 (diff)
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_mf.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream_mf.c b/stream/stream_mf.c
index 720a73f836..9b80a73d58 100644
--- a/stream/stream_mf.c
+++ b/stream/stream_mf.c
@@ -38,7 +38,7 @@ mf_stream_open (stream_t *stream, int mode)
const stream_info_t stream_info_mf = {
- "mf",
- mf_stream_open,
- { "mf", NULL },
+ .name = "mf",
+ .open = mf_stream_open,
+ .protocols = (const char*[]){ "mf", NULL },