summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvb.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_dvb.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_dvb.c')
-rw-r--r--stream/stream_dvb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index d96aea6905..af79a727eb 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -830,15 +830,15 @@ dvb_config_t *dvb_get_config(void)
const stream_info_t stream_info_dvb = {
- "dvbin",
- dvb_open,
- { "dvb", NULL },
+ .name = "dvbin",
+ .open = dvb_open,
+ .protocols = (const char*[]){ "dvb", NULL },
.priv_size = sizeof(dvb_priv_t),
.priv_defaults = &stream_defaults,
.options = stream_params,
- .url_options = {
- {"hostname", "prog"},
- {"username", "card"},
- {0}
+ .url_options = (const char*[]){
+ "hostname=prog",
+ "username=card",
+ NULL
},
};