summaryrefslogtreecommitdiffstats
path: root/mpvcore/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-07 20:03:13 +0200
committerwm4 <wm4@nowhere>2013-09-07 20:34:49 +0200
commit8894a4b0d2b38781d9ab110a18e27fef99d956f1 (patch)
treed63a78e442d69b2acc9d5b9db67de144140ef283 /mpvcore/command.c
parentd77a9244346adadd283a48ee55adebd5f8e37478 (diff)
downloadmpv-8894a4b0d2b38781d9ab110a18e27fef99d956f1.tar.bz2
mpv-8894a4b0d2b38781d9ab110a18e27fef99d956f1.tar.xz
command: make options writeable in idle mode
Until now, options could be accessed as properties via "options/name", but the access was read-only. Change it so that write access is possible in --idle mode. (All options have to support setting options at that time, simply because of the way MPlayer designed per-file options. During playback, normal properties take care of changing things, including things backed by options.) This is work in progress. There are some issues: at least setting the "vf" and "af" options won't work for strange reasons.
Diffstat (limited to 'mpvcore/command.c')
-rw-r--r--mpvcore/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mpvcore/command.c b/mpvcore/command.c
index fa2bbf963c..3e217dd5d7 100644
--- a/mpvcore/command.c
+++ b/mpvcore/command.c
@@ -1652,6 +1652,14 @@ static int mp_property_options(m_option_t *prop, int action, void *arg,
case M_PROPERTY_GET:
m_option_copy(opt->opt, ka->arg, opt->data);
return M_PROPERTY_OK;
+ case M_PROPERTY_SET:
+ if (!(mpctx->initialized_flags & INITIALIZED_PLAYBACK) &&
+ !(opt->opt->flags & (M_OPT_PRE_PARSE | M_OPT_GLOBAL)))
+ {
+ m_option_copy(opt->opt, opt->data, ka->arg);
+ return M_PROPERTY_OK;
+ }
+ return M_PROPERTY_ERROR;
case M_PROPERTY_GET_TYPE:
*(struct m_option *)ka->arg = *opt->opt;
return M_PROPERTY_OK;