summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-06 20:09:56 +0200
committerwm4 <wm4@nowhere>2016-09-06 20:09:56 +0200
commitd4d8b3a4fcf8d50af9cef9766cfefc5538be28f4 (patch)
tree1eb69ef2876dcf541bab2018e733dbe1053a0fe3 /player
parent9f0e7bb9982eef36bf2f14fd750bbe6a359011ba (diff)
downloadmpv-d4d8b3a4fcf8d50af9cef9766cfefc5538be28f4.tar.bz2
mpv-d4d8b3a4fcf8d50af9cef9766cfefc5538be28f4.tar.xz
demux: do not access global options
Don't access MPOpts directly, and always use the new m_config.h functions for accessing them in a thread-safe way. The goal is eventually removing the mpv_global.opts field, and the demuxer/stream-layer specific hack that copies MPOpts to deal with thread-safety issues. This moves around a lot of options. For one, we often change the physical storage location of options to make them more localized, but these changes are not user-visible (or should not be). For shared options on the other hand it's better to do messy direct access, which is worrying as in that somehow renaming an option or changing its type would break code reading them manually, without causing a compilation error.
Diffstat (limited to 'player')
-rw-r--r--player/main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/player/main.c b/player/main.c
index 315c2978f5..0bf207f5b7 100644
--- a/player/main.c
+++ b/player/main.c
@@ -374,13 +374,9 @@ struct MPContext *mp_create(void)
mpctx->log = mp_log_new(mpctx, mpctx->global->log, "!cplayer");
mpctx->statusline = mp_log_new(mpctx, mpctx->log, "!statusline");
- struct MPOpts *def_opts = talloc_ptrtype(mpctx, def_opts);
- *def_opts = mp_default_opts;
- def_opts->network_useragent = (char *)mpv_version;
-
// Create the config context and register the options
mpctx->mconfig = m_config_new(mpctx, mpctx->log, sizeof(struct MPOpts),
- def_opts, mp_opts);
+ &mp_default_opts, mp_opts);
mpctx->opts = mpctx->mconfig->optstruct;
mpctx->mconfig->includefunc = cfg_include;
mpctx->mconfig->includefunc_ctx = mpctx;