summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-23 21:04:20 +0200
committerwm4 <wm4@nowhere>2016-09-23 21:04:20 +0200
commitf0fd6633205fe0b477032d2be5028a204c327e0b (patch)
treed88cf3bb29827f2fe63a8227d7e17e04792ef071 /options/m_config.c
parentb9153ee177387efeedd1d5294b07a49e928d2ebd (diff)
downloadmpv-f0fd6633205fe0b477032d2be5028a204c327e0b.tar.bz2
mpv-f0fd6633205fe0b477032d2be5028a204c327e0b.tar.xz
m_config, command: remove some minor code duplication
I would have been fine with this, but now I want to add another flag, and the duplication would become more messy than having a strange function for deduplication.
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 08465df97f..5c8a99b372 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -676,6 +676,12 @@ static int handle_set_opt_flags(struct m_config *config,
return set ? 2 : 1;
}
+void m_config_mark_co_flags(struct m_config_option *co, int flags)
+{
+ if (flags & M_SETOPT_FROM_CMDLINE)
+ co->is_set_from_cmdline = true;
+}
+
// 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,
@@ -696,9 +702,7 @@ int m_config_set_option_raw_direct(struct m_config *config,
m_option_copy(co->opt, co->data, data);
- if (flags & M_SETOPT_FROM_CMDLINE)
- co->is_set_from_cmdline = true;
-
+ m_config_mark_co_flags(co, flags);
m_config_notify_change_co(config, co);
return 0;