summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-05 21:05:47 +0200
committerwm4 <wm4@nowhere>2016-09-05 21:26:39 +0200
commit633eb30cbe0e52879443633760e9460fe5bdcdfa (patch)
tree3eabbb8e58062833905344abc74f59103503ca0f /video
parent327cb2a06c32f2c05fc266272936080d06103a63 (diff)
downloadmpv-633eb30cbe0e52879443633760e9460fe5bdcdfa.tar.bz2
mpv-633eb30cbe0e52879443633760e9460fe5bdcdfa.tar.xz
options: add automagic hack for handling sub-option deprecations
I decided that it's too much work to convert all the VO/AOs to the new option system manually at once. So here's a shitty hack instead, which achieves almost the same thing. (The only user-visible difference is that e.g. --vo=name:help will list the sub-options normally, instead of showing them as deprecation placeholders. Also, the sub-option parser will verify each option normally, instead of deferring to the global option parser.) Another advantage is that once we drop the deprecated options, converting the remaining things will be easier, because we obviously don't need to add the compatibility hacks. Using this mechanism is separate in the next commit to keep the diff noise down.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c1
-rw-r--r--video/out/vo.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 3e6a2c7070..afd4b4c792 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -173,6 +173,7 @@ static bool get_desc(struct m_obj_desc *dst, int index)
.priv_defaults = vo->priv_defaults,
.options = vo->options,
.global_opts = vo->global_opts,
+ .legacy_prefix = vo->legacy_prefix,
.hidden = vo->encode || !strcmp(vo->name, "opengl-cb"),
.p = vo,
};
diff --git a/video/out/vo.h b/video/out/vo.h
index 6a6101692c..e3258a39ff 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -295,11 +295,17 @@ struct vo_driver {
const void *priv_defaults;
// List of options to parse into priv struct (requires priv_size to be set)
+ // Deprecated. Use global options or global_opts instead.
const struct m_option *options;
// Global options to register if the VO is compiled in.
// mp_get_config_group() or other function can be used to access them.
const struct m_sub_options *global_opts;
+
+ // Evil hack: add .options as global options, using the provided prefix.
+ // For further evilness, the options will be copied to the priv struct
+ // like with normal .options behavior.
+ const char *legacy_prefix;
};
struct vo {