diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst index 17fc4bd60a..165218a600 100644 --- a/DOCS/client-api-changes.rst +++ b/DOCS/client-api-changes.rst @@ -32,7 +32,10 @@ API changes :: - --- mpv 0.19.0 + --- mpv 0.21.0 --- + 1.23 - deprecate setting "no-" options via mpv_set_option*(). For example, + instead of "no-video=" you should set "video=no". + --- mpv 0.19.0 --- 1.22 - add stream_cb API for custom protocols --- mpv 0.18.1 --- ---- - remove "status" log level from mpv_request_log_messages() docs. This diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 4188aa0adc..f3861c7b82 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -24,6 +24,7 @@ Interface changes not accessible under "options/..." anymore (instead, these are resolved at parsing time). This does not affect options which start with "--no-", but do not use the mechanism for negation options. + (Also see client API change for API version 1.23.) --- mpv 0.20.0 --- - add --image-display-duration option - this also means that image duration is not influenced by --mf-fps anymore in the general case (this is an diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 7cc66dcb8d..f5a706940d 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -36,15 +36,32 @@ Track Selection See also ``--alang``. mpv normally prints available audio tracks on the terminal when starting playback of a file. + ``--audio`` is an alias for ``--aid``. + + ``--aid=no`` or ``--audio=no`` or ``--no-audio`` disables audio playback. + (The latter variant does not work with the client API.) + ``--sid=<ID|auto|no>`` Display the subtitle stream specified by ``<ID>``. ``auto`` selects the default, ``no`` disables subtitles. - See also ``--slang``, ``--no-sub``. + ``--sub`` is an alias for ``--sid``. + + ``--sid=no`` or ``--sub=no`` or ``--no-sub`` disables subtitle decoding. + (The latter variant does not work with the client API.) ``--vid=<ID|auto|no>`` Select video channel. ``auto`` selects the default, ``no`` disables video. + ``--video`` is an alias for ``--vid``. + + ``--vid=no`` or ``--video=no`` or ``--no-video`` disables video playback. + (The latter variant does not work with the client API.) + + If vudeo is disabled, mpv will try to download the audio only if media is + streamed with youtube-dl, because it saves bandwidth. This is done by + setting the ytdl_format to "bestaudio/best" in the ytdl_hook.lua script. + ``--ff-aid=<ID|auto|no>``, ``--ff-sid=<ID|auto|no>``, ``--ff-vid=<ID|auto|no>`` Select audio/subtitle/video streams by the FFmpeg stream index. The FFmpeg stream index is relatively arbitrary, but useful when interacting with @@ -517,14 +534,6 @@ Video ``--vf-clr`` exist to modify a previously specified list, but you should not need these for typical use. -``--no-video`` - Do not play video. With some demuxers this may not work. In those cases - you can try ``--vo=null`` instead. - - mpv will try to download the audio only if media is streamed with - youtube-dl, because it saves bandwidth. This is done by setting the ytdl_format - to "bestaudio/best" in the ytdl_hook.lua script. - ``--untimed`` Do not sleep when outputting video frames. Useful for benchmarks when used with ``--no-audio.`` @@ -1092,9 +1101,6 @@ Audio Audio delay in seconds (positive or negative float value). Positive values delay the audio, and negative values delay the video. -``--no-audio`` - Do not play sound. - ``--mute=<auto|yes|no>`` Set startup audio mute status. ``auto`` (default) will not change the mute status. @@ -1374,10 +1380,6 @@ Subtitles Subtitles in ASS format are normally not changed intentionally, but overriding them can be controlled with ``--ass-style-override``. - -``--no-sub`` - Do not select any subtitle when the file is loaded. - ``--sub-demuxer=<[+]name>`` Force subtitle demuxer type for ``--sub-file``. Give the demuxer name as printed by ``--sub-demuxer=help``. diff --git a/libmpv/client.h b/libmpv/client.h index fb4b29bf7e..7ec6590e64 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -215,7 +215,7 @@ extern "C" { * relational operators (<, >, <=, >=). */ #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) -#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 22) +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 23) /** * Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with. diff --git a/options/m_config.c b/options/m_config.c index 470951d233..d1bb72c13b 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -707,6 +707,7 @@ int m_config_set_option_node(struct m_config *config, bstr name, struct m_config_option *co = m_config_get_co(config, name); if (!co) { + bstr orig_name = name; co = m_config_find_negation_opt(config, &name); if (!co) return M_OPT_UNKNOWN; @@ -716,6 +717,12 @@ int m_config_set_option_node(struct m_config *config, bstr name, tmp.format = MPV_FORMAT_STRING; tmp.u.string = "no"; data = &tmp; + + if (!co->warning_was_printed) { + MP_WARN(config, "Option '%.*s': setting 'no-' option via API is " + "deprecated and will stop working.\n", BSTR_P(orig_name)); + co->warning_was_printed = true; + } } // Do this on an "empty" type to make setting the option strictly overwrite