mirror of https://github.com/mpv-player/mpv
command: remove another unneeded hack
Now that the option-to-property bridge is gone, this is not needed anymore. It always took the "silent" path. Also, at least as of before this commit, this didn't correctly print a warning when accessing a deprecated option as property. This was because m_config_get_co_raw() was used, which intentionally does not print any warnings, so switch to the non-raw one. (Affects only options that have .deprecation_message set.)
This commit is contained in:
parent
90df6c79c9
commit
56b06907a6
|
@ -104,8 +104,6 @@ struct command_ctx {
|
||||||
char *cur_ipc;
|
char *cur_ipc;
|
||||||
char *cur_ipc_input;
|
char *cur_ipc_input;
|
||||||
|
|
||||||
int silence_option_deprecations;
|
|
||||||
|
|
||||||
struct mp_cmd_ctx *cache_dump_cmd; // in progress cache dumping
|
struct mp_cmd_ctx *cache_dump_cmd; // in progress cache dumping
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -379,14 +377,8 @@ static int mp_property_generic_option(void *ctx, struct m_property *prop,
|
||||||
int action, void *arg)
|
int action, void *arg)
|
||||||
{
|
{
|
||||||
MPContext *mpctx = ctx;
|
MPContext *mpctx = ctx;
|
||||||
const char *optname = prop->name;
|
struct m_config_option *opt =
|
||||||
struct m_config_option *opt;
|
m_config_get_co(mpctx->mconfig, bstr0(prop->name));
|
||||||
if (mpctx->command_ctx->silence_option_deprecations) {
|
|
||||||
// This case is specifically for making --reset-on-next-file=all silent.
|
|
||||||
opt = m_config_get_co_raw(mpctx->mconfig, bstr0(optname));
|
|
||||||
} else {
|
|
||||||
opt = m_config_get_co(mpctx->mconfig, bstr0(optname));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!opt)
|
if (!opt)
|
||||||
return M_PROPERTY_UNKNOWN;
|
return M_PROPERTY_UNKNOWN;
|
||||||
|
@ -3543,9 +3535,7 @@ static int mp_property_do_silent(const char *name, int action, void *val,
|
||||||
struct MPContext *ctx)
|
struct MPContext *ctx)
|
||||||
{
|
{
|
||||||
struct command_ctx *cmd = ctx->command_ctx;
|
struct command_ctx *cmd = ctx->command_ctx;
|
||||||
cmd->silence_option_deprecations += 1;
|
|
||||||
int r = m_property_do(ctx->log, cmd->properties, name, action, val, ctx);
|
int r = m_property_do(ctx->log, cmd->properties, name, action, val, ctx);
|
||||||
cmd->silence_option_deprecations -= 1;
|
|
||||||
if (r == M_PROPERTY_OK && is_property_set(action, val))
|
if (r == M_PROPERTY_OK && is_property_set(action, val))
|
||||||
mp_notify_property(ctx, (char *)name);
|
mp_notify_property(ctx, (char *)name);
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in New Issue