summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-31 17:09:10 +0200
committerwm4 <wm4@nowhere>2016-08-31 22:16:19 +0200
commit7dde096d8a6d9e82cac82bec439fef47d078f352 (patch)
tree4b6656fb69f4ec62b114ebd3cab0c5e8470a9fbb /options/options.c
parente024906408c4d079e77b136de9b0562a93daadce (diff)
downloadmpv-7dde096d8a6d9e82cac82bec439fef47d078f352.tar.bz2
mpv-7dde096d8a6d9e82cac82bec439fef47d078f352.tar.xz
m_config: introduce and use OPT_ALIAS for some options
OPT_ALIAS redirects the options at a higher level, instead of introducing "duplicate" options with different name but same backing storage. This uses the OPT_REPLACED mechanisms - only the deprecation warning had to be made conditional. Note that e.g. --no-video still works, because the "--no-..." redirection and OPT_ALIAS are orthogonal. The deprecated --sub -> --sub-file alias had to be dropped, because it essentially conflicts with --no-sub. If anyone complains, this could probably still be undone by letting m_config_find_negation_opt do a special mapping for --no-sub. (Which would be dumb, but simple and effective.)
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/options/options.c b/options/options.c
index dc880d3339..92eb0fd9c5 100644
--- a/options/options.c
+++ b/options/options.c
@@ -119,7 +119,7 @@ static const m_option_t mp_vo_opt_list[] = {
OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0),
OPT_FLAG("fullscreen", fullscreen, M_OPT_FIXED),
- OPT_FLAG("fs", fullscreen, M_OPT_FIXED),
+ OPT_ALIAS("fs", "fullscreen"),
OPT_FLAG("native-keyrepeat", native_keyrepeat, M_OPT_FIXED),
OPT_FLOATRANGE("panscan", panscan, 0, 0.0, 1.0),
OPT_FLOATRANGE("video-zoom", zoom, 0, -20.0, 20.0),
@@ -303,9 +303,9 @@ const m_option_t mp_opts[] = {
OPT_TRACKCHOICE("ff-aid", stream_id_ff[STREAM_AUDIO]),
OPT_TRACKCHOICE("ff-vid", stream_id_ff[STREAM_VIDEO]),
OPT_TRACKCHOICE("ff-sid", stream_id_ff[STREAM_SUB]),
- OPT_FLAG_STORE("no-sub", stream_id[0][STREAM_SUB], 0, -2),
- OPT_FLAG_STORE("no-video", stream_id[0][STREAM_VIDEO], 0, -2),
- OPT_FLAG_STORE("no-audio", stream_id[0][STREAM_AUDIO], 0, -2),
+ OPT_ALIAS("sub", "sid"),
+ OPT_ALIAS("video", "vid"),
+ OPT_ALIAS("audio", "aid"),
OPT_STRINGLIST("alang", stream_lang[STREAM_AUDIO], 0),
OPT_STRINGLIST("slang", stream_lang[STREAM_SUB], 0),
@@ -689,7 +689,6 @@ const m_option_t mp_opts[] = {
OPT_REPLACED("ss", "start"),
OPT_REPLACED("stop-xscreensaver", "stop-screensaver"),
OPT_REPLACED("sub-fuzziness", "sub-auto"),
- OPT_REPLACED("sub", "sub-file"),
OPT_REPLACED("subcp", "sub-codepage"),
OPT_REPLACED("subdelay", "sub-delay"),
OPT_REPLACED("subfile", "sub-file"),