mirror of https://github.com/mpv-player/mpv
94782e464d
Options parsing used to be ambiguous, as in the splitting into option and values pairs was ambiguous. Example: -option -something It wasn't clear whether -option actually takes an argument or not. The string "-something" could either be a separate option, or an argument to "-option". The code had to call the option specific parser function to resolve this. This made everything complicated and didn't even have a real use. There was only one case where this was actually used: string lists (m_option_type_string_list) and options based on it. That is because this option type actually turns a single option into a proxy for several real arguments, e.g. "vf*" can handle "-vf-add" and "-vf-clr". Options suffixed with "-clr" are the only options of this group which take no arguments. This is ambiguous only with the "old syntax" (as shown above). The "new" option syntax always puts option name and value into same argument. (E.g. "--option=--something" or "--option" "--something".) Simplify the code by making it statically known whether an option takes a parameter or not with the flag M_OPT_TYPE_OLD_SYNTAX_NO_PARAM. If it's set, the option parser assumes the option takes no argument. The only real ambiguity left, string list options that end on "-clr", are special cased in the parser. Remove some duplication of the logic in the command line parser by moving all argument splitting logic into split_opt(). (It's arguable whether that can be considered code duplication, but now the code is a bit simpler anyway. This might be subjective.) Remove the "ambiguous" parameter from all option parsing related code. Make m_config unaware of the pre-parsing concept. Make most CONF_NOCFG options also CONF_GLOBAL (except those explicitly usable as per-file options.) |
||
---|---|---|
.. | ||
ai_alsa1x.c | ||
ai_oss.c | ||
asf_mmst_streaming.c | ||
asf_mmst_streaming.h | ||
asf_streaming.c | ||
audio_in.c | ||
audio_in.h | ||
cache2.c | ||
cache2.h | ||
cdd.h | ||
cdinfo.c | ||
cookies.c | ||
cookies.h | ||
dvb_tune.c | ||
dvb_tune.h | ||
dvbin.h | ||
frequencies.c | ||
frequencies.h | ||
http.c | ||
http.h | ||
network.c | ||
network.h | ||
open.c | ||
pvr.h | ||
stream.c | ||
stream.h | ||
stream_bluray.c | ||
stream_cdda.c | ||
stream_cddb.c | ||
stream_dvb.c | ||
stream_dvd.c | ||
stream_dvd.h | ||
stream_dvd_common.c | ||
stream_dvd_common.h | ||
stream_dvdnav.c | ||
stream_dvdnav.h | ||
stream_ffmpeg.c | ||
stream_file.c | ||
stream_ftp.c | ||
stream_live555.c | ||
stream_mf.c | ||
stream_nemesi.c | ||
stream_netstream.c | ||
stream_netstream.h | ||
stream_null.c | ||
stream_pvr.c | ||
stream_radio.c | ||
stream_radio.h | ||
stream_smb.c | ||
stream_tv.c | ||
stream_udp.c | ||
stream_vcd.c | ||
stream_vstream.c | ||
tcp.c | ||
tcp.h | ||
tv.c | ||
tv.h | ||
tvi_bsdbt848.c | ||
tvi_def.h | ||
tvi_dshow.c | ||
tvi_dshow.h | ||
tvi_dummy.c | ||
tvi_v4l2.c | ||
udp.c | ||
udp.h | ||
url.c | ||
url.h | ||
vcd_read.h | ||
vcd_read_darwin.h | ||
vcd_read_fbsd.h | ||
vcd_read_win32.h |