summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-15 15:22:06 +0200
committerwm4 <wm4@nowhere>2017-06-15 15:29:54 +0200
commitb8193e40719a2a72d9b25e8ea3070c0e84beb48e (patch)
tree489acbb02a0d443856853881096e650ce78fd69a /options/options.c
parentfd7de84833a7f492678e0caa18125ff9f9aa38a5 (diff)
downloadmpv-b8193e40719a2a72d9b25e8ea3070c0e84beb48e.tar.bz2
mpv-b8193e40719a2a72d9b25e8ea3070c0e84beb48e.tar.xz
command: add all options to property->option bridge
Before this, options with co->data==NULL (i.e. no storage) were not added to the bridge (except alias options). There are a few options which might make sense to allow via the bridge ("profile" and "include"). So allow them. In command_init(), we merely remove the co->data check, the rest of the diff is due to switching the if/else branches for convenience. We also must explicitly error on M_PROPERTY_GET if co->data==NULL. All other cases check it in some way. Explicitly exclude options from the property bridge, which would be added due this, and the result would be pointless.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/options/options.c b/options/options.c
index 1bcdc720f2..90cbe61d6f 100644
--- a/options/options.c
+++ b/options/options.c
@@ -254,21 +254,25 @@ const struct m_sub_options dvd_conf = {
const m_option_t mp_opts[] = {
// handled in command line pre-parser (parse_commandline.c)
- {"v", CONF_TYPE_STORE, M_OPT_FIXED | CONF_NOCFG, .offset = -1},
+ {"v", CONF_TYPE_STORE, M_OPT_FIXED | CONF_NOCFG | M_OPT_NOPROP, .offset = -1},
{"playlist", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_MIN | M_OPT_FIXED | M_OPT_FILE,
.min = 1, .offset = -1},
- {"{", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
- {"}", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
+ {"{", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, .offset = -1},
+ {"}", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, .offset = -1},
// handled in m_config.c
{ "include", CONF_TYPE_STRING, M_OPT_FILE, .offset = -1},
{ "profile", CONF_TYPE_STRING_LIST, 0, .offset = -1},
- { "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
- { "list-options", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
+ { "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP,
+ .offset = -1},
+ { "list-options", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP,
+ .offset = -1},
OPT_FLAG("list-properties", property_print_help,
CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP),
- { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
- { "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1},
+ { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP,
+ .offset = -1},
+ { "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP,
+ .offset = -1},
OPT_PRINT("list-protocols", stream_print_proto_list),
OPT_PRINT("version", print_version),