From d26b5daf3ed32136540d39614afe7ef631a1319f Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 Jan 2020 21:12:29 +0100 Subject: command: make sub-step command actually apply sub-delay change properly The change was not propagated to the OSD/subtitle code, since that still uses an "old" method. Change it so that the propagation is actually performed. (One could argue the OSD/subtitle code should use other ways to update the options, but that would probably be more effort for now.) --- options/m_config.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'options/m_config.c') diff --git a/options/m_config.c b/options/m_config.c index 968999cb71..00557c5673 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -1000,13 +1000,13 @@ static void force_self_notify_change_opt(struct m_config *config, } } -void m_config_notify_change_opt_ptr(struct m_config *config, void *ptr) +static void notify_opt(struct m_config *config, void *ptr, bool self_notification) { for (int n = 0; n < config->num_opts; n++) { struct m_config_option *co = &config->opts[n]; if (co->data == ptr) { if (m_config_cache_write_opt(config->cache, co->data)) - force_self_notify_change_opt(config, co, true); + force_self_notify_change_opt(config, co, self_notification); return; } } @@ -1015,6 +1015,18 @@ void m_config_notify_change_opt_ptr(struct m_config *config, void *ptr) assert(false); } +void m_config_notify_change_opt_ptr(struct m_config *config, void *ptr) +{ + notify_opt(config, ptr, true); +} + +void m_config_notify_change_opt_ptr_notify(struct m_config *config, void *ptr) +{ + // (the notify bool is inverted: by not marking it as self-notification, + // the mpctx option change handler actually applies it) + notify_opt(config, ptr, false); +} + int m_config_set_option_raw(struct m_config *config, struct m_config_option *co, void *data, int flags) -- cgit v1.2.3