summaryrefslogtreecommitdiffstats
path: root/common/encode_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-10 23:49:23 +0100
committerwm4 <wm4@nowhere>2019-11-10 23:49:23 +0100
commit4cae19237758a21685c9d988d24dafac713f3a30 (patch)
tree066c6a4fa77239a2a43b546d7b2182d0b7432c70 /common/encode_lavc.c
parent20c9538e3236779fabe21c6fbdb7e6e039bd32b1 (diff)
downloadmpv-4cae19237758a21685c9d988d24dafac713f3a30.tar.bz2
mpv-4cae19237758a21685c9d988d24dafac713f3a30.tar.xz
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after initialization (mpv_initialize() in the client API, after option parsing and config file loading with the CLI player). This used to be necessary, because there was a single option struct that could be accessed by multiple threads. For example, --config-dir sets MPOpts.force_configdir, which was read whenever anything accessed the mpv config dir (which could be on different threads, e.g. font initialization tries to lookup fonts.conf from an arbitrary thread). This isn't needed anymore, because threads now access these in a thread safe way. In the case of --config-dir, the path is actually just copied on init. This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still prevents writing to some options that cannot take effect at runtime, but even that can be dropped. In general, all mpv options can be changed any time at runtime, even if they never take effect, and there's no need to make an exception for a very low number of options. So just get rid of it.
Diffstat (limited to 'common/encode_lavc.c')
-rw-r--r--common/encode_lavc.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index 8066173d1c..2b9bdb4a66 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -77,25 +77,25 @@ struct mux_stream {
#define OPT_BASE_STRUCT struct encode_opts
const struct m_sub_options encode_config = {
.opts = (const m_option_t[]) {
- OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
- OPT_STRING("of", format, M_OPT_FIXED),
- OPT_KEYVALUELIST("ofopts", fopts, M_OPT_FIXED | M_OPT_HAVE_HELP),
- OPT_STRING("ovc", vcodec, M_OPT_FIXED),
- OPT_KEYVALUELIST("ovcopts", vopts, M_OPT_FIXED | M_OPT_HAVE_HELP),
- OPT_STRING("oac", acodec, M_OPT_FIXED),
- OPT_KEYVALUELIST("oacopts", aopts, M_OPT_FIXED | M_OPT_HAVE_HELP),
- OPT_FLOATRANGE("ovoffset", voffset, M_OPT_FIXED, -1000000.0, 1000000.0,
+ OPT_STRING("o", file, CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
+ OPT_STRING("of", format, 0),
+ OPT_KEYVALUELIST("ofopts", fopts, M_OPT_HAVE_HELP),
+ OPT_STRING("ovc", vcodec, 0),
+ OPT_KEYVALUELIST("ovcopts", vopts, M_OPT_HAVE_HELP),
+ OPT_STRING("oac", acodec, 0),
+ OPT_KEYVALUELIST("oacopts", aopts, M_OPT_HAVE_HELP),
+ OPT_FLOATRANGE("ovoffset", voffset, 0, -1000000.0, 1000000.0,
.deprecation_message = "--audio-delay (once unbroken)"),
- OPT_FLOATRANGE("oaoffset", aoffset, M_OPT_FIXED, -1000000.0, 1000000.0,
+ OPT_FLOATRANGE("oaoffset", aoffset, 0, -1000000.0, 1000000.0,
.deprecation_message = "--audio-delay (once unbroken)"),
- OPT_FLAG("orawts", rawts, M_OPT_FIXED),
- OPT_FLAG("ovfirst", video_first, M_OPT_FIXED,
+ OPT_FLAG("orawts", rawts, 0),
+ OPT_FLAG("ovfirst", video_first, 0,
.deprecation_message = "no replacement"),
- OPT_FLAG("oafirst", audio_first, M_OPT_FIXED,
+ OPT_FLAG("oafirst", audio_first, 0,
.deprecation_message = "no replacement"),
- OPT_FLAG("ocopy-metadata", copy_metadata, M_OPT_FIXED),
- OPT_KEYVALUELIST("oset-metadata", set_metadata, M_OPT_FIXED),
- OPT_STRINGLIST("oremove-metadata", remove_metadata, M_OPT_FIXED),
+ OPT_FLAG("ocopy-metadata", copy_metadata, 0),
+ OPT_KEYVALUELIST("oset-metadata", set_metadata, 0),
+ OPT_STRINGLIST("oremove-metadata", remove_metadata, 0),
OPT_REMOVED("ocopyts", "ocopyts is now the default"),
OPT_REMOVED("oneverdrop", "no replacement"),