diff options
author | wm4 <wm4@nowhere> | 2016-09-02 15:45:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-02 15:50:40 +0200 |
commit | 423e53ba0bad034685e5229720d55548afb1efbe (patch) | |
tree | 08c8ed2d32f7c7ed88b3d468d09249adec6017ee /player/main.c | |
parent | f2e25e9e1f5aa28689d152d7a7cb4c39bdac9c82 (diff) | |
download | mpv-423e53ba0bad034685e5229720d55548afb1efbe.tar.bz2 mpv-423e53ba0bad034685e5229720d55548afb1efbe.tar.xz |
m_config: introduce basic mechanism to synchronize global option updates
The way option runtime changes are handled is pretty bad in the current
codebase. There's a big option struct (MPOpts), which contains almost
everything, and for which no synchronization mechanism exists. This was
handled by either making some options read-only after initialization,
duplicating the option struct, using sub-options (in the VO), and so on.
Introduce a mechanism that creates a copy of the global options (or
parts of it), and provides a well-defined way to update them in a
thread-safe way.
Most code can remain the same, just that all the component glue code has
to explicitly make use of it first.
There is still lots of room for improvement. For example, the update
mechanism could be better.
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c index 6acb617520..b60c522cb0 100644 --- a/player/main.c +++ b/player/main.c @@ -364,6 +364,7 @@ struct MPContext *mp_create(void) mpctx->mconfig->is_toplevel = true; mpctx->mconfig->global = mpctx->global; m_config_parse(mpctx->mconfig, "", bstr0(def_config), NULL, 0); + m_config_create_shadow(mpctx->mconfig); mpctx->global->opts = mpctx->opts; |