summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-10 23:53:57 +0100
committerwm4 <wm4@nowhere>2019-11-10 23:53:57 +0100
commit07fd511e143f8fd17d9e662ca0c060527c29e0e1 (patch)
tree252812b9cacfb3e1fcd52669b5a2b9ca2369d8e3
parent4cae19237758a21685c9d988d24dafac713f3a30 (diff)
downloadmpv-07fd511e143f8fd17d9e662ca0c060527c29e0e1.tar.bz2
mpv-07fd511e143f8fd17d9e662ca0c060527c29e0e1.tar.xz
options: remove M_SETOPT_RUNTIME
Used to contain flags for "save" setting of options at runtime. Now there is nothing special needed anymore and it's 0. So drop it completely, and remove anything that distinguishes between runtime and initialization time.
-rw-r--r--options/m_config.h3
-rw-r--r--player/client.c7
-rw-r--r--player/command.c15
-rw-r--r--player/configfiles.c3
-rw-r--r--player/loadfile.c2
5 files changed, 10 insertions, 20 deletions
diff --git a/options/m_config.h b/options/m_config.h
index 3456aab526..1b9648bd7f 100644
--- a/options/m_config.h
+++ b/options/m_config.h
@@ -154,9 +154,6 @@ enum {
M_SETOPT_NO_OVERWRITE = 256, // Skip options marked with FROM_*
};
-// Flags for safe option setting during runtime.
-#define M_SETOPT_RUNTIME 0
-
// Set the named option to the given string. This is for command line and config
// file use only.
// flags: combination of M_SETOPT_* flags (0 for normal operation)
diff --git a/player/client.c b/player/client.c
index ccd6a1d0a0..a22b56a188 100644
--- a/player/client.c
+++ b/player/client.c
@@ -930,7 +930,6 @@ void mpv_free_node_contents(mpv_node *node)
int mpv_set_option(mpv_handle *ctx, const char *name, mpv_format format,
void *data)
{
- int flags = ctx->mpctx->initialized ? M_SETOPT_RUNTIME : 0;
const struct m_option *type = get_mp_type(format);
if (!type)
return MPV_ERROR_OPTION_FORMAT;
@@ -941,8 +940,7 @@ int mpv_set_option(mpv_handle *ctx, const char *name, mpv_format format,
data = &tmp;
}
lock_core(ctx);
- int err = m_config_set_option_node(ctx->mpctx->mconfig, bstr0(name),
- data, flags);
+ int err = m_config_set_option_node(ctx->mpctx->mconfig, bstr0(name), data, 0);
unlock_core(ctx);
switch (err) {
case M_OPT_MISSING_PARAM:
@@ -1715,9 +1713,8 @@ int mpv_hook_continue(mpv_handle *ctx, uint64_t id)
int mpv_load_config_file(mpv_handle *ctx, const char *filename)
{
- int flags = ctx->mpctx->initialized ? M_SETOPT_RUNTIME : 0;
lock_core(ctx);
- int r = m_config_parse_config_file(ctx->mpctx->mconfig, filename, NULL, flags);
+ int r = m_config_parse_config_file(ctx->mpctx->mconfig, filename, NULL, 0);
unlock_core(ctx);
if (r == 0)
return MPV_ERROR_INVALID_PARAMETER;
diff --git a/player/command.c b/player/command.c
index ff1e10bdfe..28f48b43e1 100644
--- a/player/command.c
+++ b/player/command.c
@@ -427,7 +427,6 @@ static int mp_property_generic_option(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
const char *optname = prop->name;
- int flags = M_SETOPT_RUNTIME;
struct m_config_option *opt;
if (mpctx->command_ctx->silence_option_deprecations) {
// This case is specifically for making --reset-on-next-file=all silent.
@@ -449,7 +448,7 @@ static int mp_property_generic_option(void *ctx, struct m_property *prop,
m_option_copy(opt->opt, arg, opt->data);
return M_PROPERTY_OK;
case M_PROPERTY_SET:
- if (m_config_set_option_raw_direct(mpctx->mconfig, opt, arg, flags) < 0)
+ if (m_config_set_option_raw_direct(mpctx->mconfig, opt, arg, 0) < 0)
return M_PROPERTY_ERROR;
return M_PROPERTY_OK;
}
@@ -2793,13 +2792,11 @@ skip_warn: ;
*(float *)arg = aspect;
return M_PROPERTY_OK;
}
- case M_PROPERTY_SET: {
- int flags = M_SETOPT_RUNTIME;
- if (m_config_set_option_raw_direct(mpctx->mconfig, opt, arg, flags) < 0)
+ case M_PROPERTY_SET:
+ if (m_config_set_option_raw_direct(mpctx->mconfig, opt, arg, 0) < 0)
return M_PROPERTY_ERROR;
return M_PROPERTY_OK;
}
- }
return M_PROPERTY_NOT_IMPLEMENTED;
}
@@ -3329,7 +3326,7 @@ static int access_options(struct m_property_action_arg *ka, bool local,
case M_PROPERTY_SET: {
if (local && !mpctx->playing)
return M_PROPERTY_ERROR;
- int flags = M_SETOPT_RUNTIME | (local ? M_SETOPT_BACKUP : 0);
+ int flags = local ? M_SETOPT_BACKUP : 0;
int r = m_config_set_option_raw(mpctx->mconfig, opt, ka->arg, flags);
mp_wakeup_core(mpctx);
return r < 0 ? M_PROPERTY_ERROR : M_PROPERTY_OK;
@@ -4803,7 +4800,7 @@ static void cmd_change_list(void *p)
char *optname = mp_tprintf(80, "%s-%s", name, op); // the dirty truth
int r = m_config_set_option_cli(mpctx->mconfig, bstr0(optname),
- bstr0(value), M_SETOPT_RUNTIME);
+ bstr0(value), 0);
if (r < 0) {
set_osd_msg(mpctx, osdl, osd_duration,
"Failed setting option: '%s'", name);
@@ -5672,7 +5669,7 @@ static void cmd_apply_profile(void *p)
struct MPContext *mpctx = cmd->mpctx;
char *profile = cmd->args[0].v.s;
- if (m_config_set_profile(mpctx->mconfig, profile, M_SETOPT_RUNTIME) < 0)
+ if (m_config_set_profile(mpctx->mconfig, profile, 0) < 0)
cmd->success = false;
}
diff --git a/player/configfiles.c b/player/configfiles.c
index 93fd645d1f..668b34c542 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -94,8 +94,7 @@ static int try_load_config(struct MPContext *mpctx, const char *file, int flags,
// Set options file-local, and don't set them if the user set them via the
// command line.
-#define FILE_LOCAL_FLAGS \
- (M_SETOPT_BACKUP | M_SETOPT_RUNTIME | M_SETOPT_PRESERVE_CMDLINE)
+#define FILE_LOCAL_FLAGS (M_SETOPT_BACKUP | M_SETOPT_PRESERVE_CMDLINE)
static void mp_load_per_file_config(struct MPContext *mpctx)
{
diff --git a/player/loadfile.c b/player/loadfile.c
index 747793b645..09b7167f60 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -973,7 +973,7 @@ static void load_per_file_options(m_config_t *conf,
{
for (int n = 0; n < params_count; n++) {
m_config_set_option_cli(conf, params[n].name, params[n].value,
- M_SETOPT_RUNTIME | M_SETOPT_BACKUP);
+ M_SETOPT_BACKUP);
}
}