summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-01-04 21:12:29 +0100
committerwm4 <wm4@nowhere>2020-01-04 21:12:29 +0100
commitd26b5daf3ed32136540d39614afe7ef631a1319f (patch)
treee8859fd59636bd00d7e02f252ce8e9a5fa9d4307 /options/m_config.c
parent1b0129c4143fe73ef0ee3c3f1e2bed734c374d40 (diff)
downloadmpv-d26b5daf3ed32136540d39614afe7ef631a1319f.tar.bz2
mpv-d26b5daf3ed32136540d39614afe7ef631a1319f.tar.xz
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.)
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c16
1 files changed, 14 insertions, 2 deletions
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)