diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index cf622e5c31..431ff1a7de 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -87,12 +87,9 @@ :``--afm=ffmpeg``: Try FFmpeg's libavcodec codecs first. :``--afm=acm,dshow``: Try Win32 codecs first. ---aid= - Select audio channel (MPEG: 0-31, AVI/OGM: 1-99, ASF/RM: 0-127, VOB(AC-3): - 128-159, VOB(LPCM): 160-191, MPEG-TS 17-8190). MPlayer prints the - available audio IDs when run in verbose (-v) mode. When playing an MPEG-TS - stream, MPlayer will use the first program (if present) with the chosen - audio stream. See also ``--alang``. +--aid= + Select audio channel. ``auto`` selects the default, ``off`` disables audio. + See also ``--alang``. --alang= Specify a priority list of audio languages to use. Different container @@ -1271,17 +1268,15 @@ Do not use index present in the file even if one is present. --no-audio - Do not play sound. Useful for benchmarking. + Do not play sound. With some demuxers this may not work. In those cases + you can try ``--ao=null`` instead. --no-sub - Disables any otherwise auto-selected internal subtitles (as e.g. the - Matroska/mkv demuxer supports). Use ``--no-autosub`` to disable the - loading of external subtitle files. + Disables display of internal and external subtitles. --no-video Do not play video. With some demuxers this may not work. In those cases - you can try ``--vc=null --vo=null`` instead; but ``--vc=null`` is always - unreliable. + you can try ``--vo=null`` instead. --ontop Makes the player window stay on top of other windows. Supported by video @@ -1699,10 +1694,9 @@ --shuffle Play files in random order. ---sid= - Display the subtitle stream specified by (0-31). MPlayer prints the - available subtitle IDs when run in verbose (``-v``) mode. If you cannot - select one of the subtitles on a DVD, try ``--vobsubid``. +--sid= + Display the subtitle stream specified by (0-31). ``auto`` selects the + default, ``off`` disables subtitles. See also ``--slang``, ``--vobsubid``, ``--no-sub``. --slang= @@ -2262,10 +2256,8 @@ :``--vfm=xanim``: Try XAnim codecs first. ---vid= - Select video channel (MPG: 0-15, ASF: 0-255, MPEG-TS: 17-8190). When - playing an MPEG-TS stream, MPlayer will use the first program (if present) - with the chosen video stream. +--vid= + Select video channel. ``auto`` selects the default, ``off`` disables video. --vm Try to change to a different video mode. Supported by the x11 and xv video diff --git a/cfg-mplayer.h b/cfg-mplayer.h index e433e91955..fa5f35af6c 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -397,12 +397,11 @@ const m_option_t common_opts[] = { {"loadidx", &index_file_load, CONF_TYPE_STRING, 0, 0, 0, NULL}, // select audio/video/subtitle stream - OPT_INTRANGE("aid", audio_id, 0, -2, 8190), - OPT_INTRANGE("vid", video_id, 0, -2, 8190), - OPT_INTRANGE("sid", sub_id, 0, -2, 8190), + OPT_TRACKCHOICE("aid", audio_id), + OPT_TRACKCHOICE("vid", video_id), + OPT_TRACKCHOICE("sid", sub_id), OPT_FLAG_CONSTANTS("no-sub", sub_id, 0, -1, -2), OPT_FLAG_CONSTANTS("no-video", video_id, 0, -1, -2), - OPT_FLAG_CONSTANTS("audio", audio_id, 0, -2, -1), OPT_FLAG_CONSTANTS("no-audio", audio_id, 0, -1, -2), OPT_STRINGLIST("alang", audio_lang, 0), OPT_STRINGLIST("slang", sub_lang, 0), diff --git a/m_option.h b/m_option.h index 2b3ab13355..57fdc33610 100644 --- a/m_option.h +++ b/m_option.h @@ -471,6 +471,8 @@ static inline void m_option_free(const m_option_t *opt, void *dst) #define OPT_CHOICE_OR_INT_(optname, varname, flags, minval, maxval, choices, ...) OPT_GENERAL(optname, varname, (flags) | CONF_RANGE, .min = minval, .max = maxval, .priv = (void *)&(const struct m_opt_choice_alternatives[]){OPT_HELPER_REMOVEPAREN choices, {NULL}}, __VA_ARGS__) #define OPT_TIME(...) OPT_GENERAL(__VA_ARGS__, .type = &m_option_type_time) +#define OPT_TRACKCHOICE(name, var) OPT_CHOICE_OR_INT(name, var, 0, 0, 8190, ({"off", -2}, {"no", -2}, {"auto", -1})) + // subconf must have the type struct m_sub_options. // flagv should be M_OPT_MERGE or M_OPT_FLATTEN. // varname refers to the field, that must be a pointer to a field described by