From caa939aa91157937759a8be54f9c794d05fd0120 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 18 May 2014 18:57:02 +0200 Subject: options: unify code for setting string and "raw" options The code paths for setting options by string and by direct "raw" value were too different, which resulted in some weird code. Make the code paths closer to each other. Also, use this to remove the weirdness in the mpv_set_option() implementation. --- player/command.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index fd0f589053..5e09079866 100644 --- a/player/command.c +++ b/player/command.c @@ -2273,12 +2273,11 @@ static int access_options(struct m_property_action_arg *ka, MPContext *mpctx) case M_PROPERTY_GET: m_option_copy(opt->opt, ka->arg, opt->data); return M_PROPERTY_OK; - case M_PROPERTY_SET: - if (!(opt->opt->flags & (M_OPT_PRE_PARSE | M_OPT_FIXED))) { - m_option_copy(opt->opt, opt->data, ka->arg); - return M_PROPERTY_OK; - } - return M_PROPERTY_ERROR; + case M_PROPERTY_SET: { + int r = m_config_set_option_raw(mpctx->mconfig, opt, ka->arg, + M_SETOPT_RUNTIME); + return r < 0 ? M_PROPERTY_ERROR : M_PROPERTY_OK; + } case M_PROPERTY_GET_TYPE: *(struct m_option *)ka->arg = *opt->opt; return M_PROPERTY_OK; -- cgit v1.2.3