diff options
author | wm4 <wm4@nowhere> | 2016-09-17 20:48:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-17 20:48:22 +0200 |
commit | a3e8ff624c8adf3b18dddea0fdede7b7fa8c4eb1 (patch) | |
tree | b5ed419e0ea57138e584e560c17cecb207d49364 /player/command.h | |
parent | 2d34171bec55294375e57f8bea86e2dee153d2cc (diff) | |
download | mpv-a3e8ff624c8adf3b18dddea0fdede7b7fa8c4eb1.tar.bz2 mpv-a3e8ff624c8adf3b18dddea0fdede7b7fa8c4eb1.tar.xz |
options: take care of propertly updating options on runtime changes
All option write accesses are now put through the property interface,
which means runtime option value verification and runtime updates are
applied. This is done even for command line arguments and config files.
This has many subtle and not-so-subtle consequences. The potential for
unintended and intended subtle or not-subtle behavior changes is very
large.
Architecturally, this is us literally jumping through hoops. It really
should work the other way around, with options being able to have
callbacks for value verification and applying runtime updates. But this
would require rewriting the entirety of command.c. This change is more
practical, and if anything will at least allow incremental changes.
Some options are too incompatible for this to work - these are excluded
with an explicit blacklist.
This change fixes many issues caused by the mismatch between properties
and options. For example, this fixes #3281.
Diffstat (limited to 'player/command.h')
-rw-r--r-- | player/command.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/player/command.h b/player/command.h index c082d8d0d7..33e5b74927 100644 --- a/player/command.h +++ b/player/command.h @@ -24,6 +24,7 @@ struct MPContext; struct mp_cmd; struct mp_log; struct mpv_node; +struct m_config_option; void command_init(struct MPContext *mpctx); void command_uninit(struct MPContext *mpctx); @@ -35,6 +36,8 @@ void property_print_help(struct MPContext *mpctx); int mp_property_do(const char* name, int action, void* val, struct MPContext *mpctx); +int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flags); + void mp_notify(struct MPContext *mpctx, int event, void *arg); void mp_notify_property(struct MPContext *mpctx, const char *property); |