From a3e8ff624c8adf3b18dddea0fdede7b7fa8c4eb1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 17 Sep 2016 20:48:22 +0200 Subject: 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. --- player/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/main.c') diff --git a/player/main.c b/player/main.c index d4c31a4726..12f0191fc6 100644 --- a/player/main.c +++ b/player/main.c @@ -356,6 +356,9 @@ struct MPContext *mp_create(void) mp_input_set_cancel(mpctx->input, mpctx->playback_abort); + mpctx->mconfig->option_set_callback = mp_on_set_option; + mpctx->mconfig->option_set_callback_cb = mpctx; + return mpctx; } -- cgit v1.2.3