summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-02 15:59:40 +0200
committerwm4 <wm4@nowhere>2016-09-02 21:21:47 +0200
commit849480d0c9d5ef76bd3296034b2ad5019fb9c21d (patch)
treeef72fcfbbcce7fb0c88048ae70a0ec42cdf7866a /options/m_option.c
parenta07dae57e31882024518008c5c1c45f932c15193 (diff)
downloadmpv-849480d0c9d5ef76bd3296034b2ad5019fb9c21d.tar.bz2
mpv-849480d0c9d5ef76bd3296034b2ad5019fb9c21d.tar.xz
vo_opengl: deprecate sub-options, add them as global options
vo_opengl sub-option were always rather annoying to handle. It seems better to make them global options instead. This is simpler and easier to use. The only disadvantage we are aware of is that it's not clear that many/all of these new global options work with vo_opengl only. --vo=opengl-hq is also deprecated. There is extensive compatibility with the old behavior. One exception is that --vo-defaults will not apply to opengl-hq (though with opengl it still works). vo-cmdline is also dysfunctional and will be removed in a following commit. These changes also affect opengl-cb. The update mechanism is still rather inefficient: it requires syncing with the VO after each option change, rather than batching updates. There's also no granularity (video.c just updates "everything", and if auto-ICC profiles are enabled, vo_opengl.c will fetch them on each update). Most of the manpage changes were done by Niklas Haas <git@haasn.xyz>.
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/options/m_option.c b/options/m_option.c
index a44ca0012d..3cd9a1fb8c 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -2653,8 +2653,11 @@ static int get_obj_param(struct mp_log *log, bstr opt_name, bstr obj_name,
{
int r;
- if (!config)
- return 0; // skip
+ if (!config) {
+ *out_name = name; // preserve args for opengl-hq legacy handling
+ *out_val = val;
+ return 1;
+ }
// va.start != NULL => of the form name=val (not positional)
// If it's just "name", and the associated option exists and is a flag,
@@ -3356,3 +3359,13 @@ const m_option_type_t m_option_type_alias = {
const m_option_type_t m_option_type_removed = {
.name = "removed",
};
+
+static int parse_dummy(struct mp_log *log, const m_option_t *opt,
+ struct bstr name, struct bstr param, void *dst)
+{
+ return 1;
+}
+const m_option_type_t m_option_type_subopt_legacy = {
+ .name = "legacy suboption",
+ .parse = parse_dummy,
+};