From 7c6570402bb203a1f1deb5b76807a9c021f47e82 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Nov 2019 20:25:20 +0100 Subject: options: remove options-to-property bridge The previous bunch of commits made this unnecessary, so this should be a purely internal change with no user impact. This may or may not open the way to future improvements. Even if not, at least the property/option interaction should now be much less buggy. --- options/m_config.c | 24 +++--------------------- options/m_config.h | 11 ----------- 2 files changed, 3 insertions(+), 32 deletions(-) (limited to 'options') diff --git a/options/m_config.c b/options/m_config.c index 3fe8a67235..46b67a774f 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -814,9 +814,9 @@ static int m_config_handle_special_options(struct m_config *config, return M_OPT_UNKNOWN; } -int m_config_set_option_raw_direct(struct m_config *config, - struct m_config_option *co, - void *data, int flags) +int m_config_set_option_raw(struct m_config *config, + struct m_config_option *co, + void *data, int flags) { if (!co) return M_OPT_UNKNOWN; @@ -842,24 +842,6 @@ int m_config_set_option_raw_direct(struct m_config *config, return 0; } -int m_config_set_option_raw(struct m_config *config, struct m_config_option *co, - void *data, int flags) -{ - if (!co) - return M_OPT_UNKNOWN; - - if (config->option_set_callback) { - int r = handle_set_opt_flags(config, co, flags); - if (r <= 1) - return r; - - return config->option_set_callback(config->option_set_callback_cb, - co, data, flags); - } else { - return m_config_set_option_raw_direct(config, co, data, flags); - } -} - // Handle CLI exceptions to option handling. // Used to turn "--no-foo" into "--foo=no". // It also handles looking up "--vf-add" as "--vf". diff --git a/options/m_config.h b/options/m_config.h index a897ca053b..120a82b768 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -71,11 +71,6 @@ typedef struct m_config { int (*includefunc)(void *ctx, char *filename, int flags); void *includefunc_ctx; - // Can intercept option write accesses. - int (*option_set_callback)(void *ctx, struct m_config_option *co, - void *data, int flags); - void *option_set_callback_cb; - // Notification after an option was successfully written to. // Uses flags as set in UPDATE_OPTS_MASK. void (*option_change_callback)(void *ctx, struct m_config_option *co, @@ -169,12 +164,6 @@ int m_config_set_option_raw(struct m_config *config, struct m_config_option *co, void m_config_mark_co_flags(struct m_config_option *co, int flags); -// Unlike m_config_set_option_raw() this does not go through the property layer -// via config.option_set_callback. -int m_config_set_option_raw_direct(struct m_config *config, - struct m_config_option *co, - void *data, int flags); - // Convert the mpv_node to raw option data, then call m_config_set_option_raw(). struct mpv_node; int m_config_set_option_node(struct m_config *config, bstr name, -- cgit v1.2.3