diff options
-rw-r--r-- | DOCS/interface-changes.rst | 8 | ||||
-rw-r--r-- | DOCS/man/mpv.rst | 29 | ||||
-rw-r--r-- | DOCS/man/options.rst | 34 | ||||
-rw-r--r-- | options/m_option.c | 6 | ||||
-rw-r--r-- | options/m_option.h | 5 | ||||
-rw-r--r-- | options/options.c | 16 | ||||
-rw-r--r-- | video/out/opengl/video.c | 7 | ||||
-rw-r--r-- | video/out/opengl/video.h | 1 |
8 files changed, 84 insertions, 22 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 93894f2404..a678e0d528 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -38,6 +38,14 @@ Interface changes - --field-dominance is deprecated (use --vf=setfield=bff or tff) - --really-quiet subtle behavior change - the deprecated handling of setting "no-" options via client API is dropped + - the following options change to append-by-default (and possibly separator): + --script + --audio-file-paths + --sub-paths + also, the following options are deprecated: + --audio-file-paths => --audio-file-path + --sub-paths => --sub-file-path + --opengl-shaders => --opengl-shader --- mpv 0.25.0 --- - remove opengl-cb dxva2 dummy hwdec interop (see git "vo_opengl: remove dxva2 dummy hwdec backend") diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index 1da99715dc..9befe435da 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -416,6 +416,35 @@ file stops playing. If option ``--c`` is changed during playback of file-local options. The option ``--a`` is never reset here. +List Options +------------ + +Some options which store lists of option values can have action suffixes. For +example, you can set a ``,``-separated list of filters with ``--vf``, but the +option also allows you to append filters with ``--vf-append``. + +Options for filenames do not use ``,`` as separator, but ``:`` (Unix) or ``;`` +(Windows). + +============= =============================================== +Suffix Meaning +============= =============================================== +-add Append 1 or more items +-add-str Append single item (avoids need for escaping) +-clr Clear the option +-del Delete an existing item by integer index +-pre Prepend 1 or more items +-set Set a list of items +============= =============================================== + +Although some operations allow specifiying multiple ``,``-separated items, using +this is strongly discouraged and deprecated, except for ``-set``. + +Without suffix, the action taken is normally ``-set``. + +Some options (like ``--sub-file``, ``--audio-file``, ``--opengl-shader``) append +one file per option use. Their default action is ``-add-str``. + Playing DVDs ------------ diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 2be7de2195..5b2e838243 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1367,6 +1367,8 @@ Audio option will add a new audio track. The details are similar to how ``--sub-file`` works. + This is a list option. See `List Options`_ for details. + ``--audio-format=<format>`` Select the sample format used for output from the audio filter layer to the sound card. The values that ``<format>`` can adopt are listed below in @@ -1433,11 +1435,14 @@ Audio :no: Don't automatically load external audio files. :exact: Load the media filename with audio file extension (default). :fuzzy: Load all audio files containing media filename. - :all: Load all audio files in the current and ``--audio-file-paths`` + :all: Load all audio files in the current and ``--audio-file-path`` directories. ``--audio-file-paths=<path1:path2:...>`` - Equivalent to ``--sub-paths`` option, but for auto-loaded audio files. + Deprecated, use ``--audio-file-path``. + +``--audio-file-path=path1>`` + Equivalent to ``--sub-file-path`` option, but for auto-loaded audio files. ``--audio-client-name=<name>`` The application name the player reports to the audio API. Can be useful @@ -1512,6 +1517,8 @@ Subtitles and ``--secondary-sid`` to select the second index. (The index is printed on the terminal output after the ``--sid=`` in the list of streams.) + This is a list option. See `List Options`_ for details. + ``--secondary-sid=<ID|auto|no>`` Select a secondary subtitle stream. This is similar to ``--sid``. If a secondary subtitle is selected, it will be rendered as toptitle (i.e. on @@ -1786,7 +1793,7 @@ Subtitles :no: Don't automatically load external subtitle files. :exact: Load the media filename with subtitle file extension (default). :fuzzy: Load all subs containing media filename. - :all: Load all subs in the current and ``--sub-paths`` directories. + :all: Load all subs in the current and ``--sub-file-path`` directories. ``--sub-codepage=<codepage>`` You can use this option to specify the subtitle codepage. uchardet will be @@ -1854,6 +1861,9 @@ Subtitles Never applied to text subtitles. ``--sub-paths=<path1:path2:...>`` + Deprecated, use ``--sub-file-path``. + +``--sub-file-path=path`` Specify extra directories to search for subtitles matching the video. Multiple directories can be separated by ":" (";" on Windows). Paths can be relative or absolute. Relative paths are interpreted relative @@ -1864,15 +1874,16 @@ Subtitles .. admonition:: Example Assuming that ``/path/to/video/video.avi`` is played and - ``--sub-paths=sub:subtitles:/tmp/subs`` is specified, mpv searches for - subtitle files in these directories: + ``--sub-file-path=sub --sub-file-path=subtitles`` is specified, mpv + searches for subtitle files in these directories: - ``/path/to/video/`` - ``/path/to/video/sub/`` - ``/path/to/video/subtitles/`` - - ``/tmp/subs/`` - the ``sub`` configuration subdirectory (usually ``~/.config/mpv/sub/``) + This is a list option. See `List Options`_ for details. + ``--sub-visibility``, ``--no-sub-visibility`` Can be used to disable display of subtitles, but still select and decode them. @@ -4156,10 +4167,11 @@ The following video options are currently all specific to ``--vo=opengl`` and results, as can missing or incorrect display FPS information (see ``--display-fps``). -``--opengl-shaders=<files>`` +``--opengl-shader=<file>`` Custom GLSL hooks. These are a flexible way to add custom fragment shaders, which can be injected at almost arbitrary points in the rendering pipeline, - and access all previous intermediate textures. + and access all previous intermediate textures. Each use of the option will + add another file to the internal list of shaders (see `List Options`_). .. admonition:: Warning @@ -4316,6 +4328,10 @@ The following video options are currently all specific to ``--vo=opengl`` and pass. When overwriting a texture marked ``fixed``, the WIDTH, HEIGHT and OFFSET must be left at their default values. +``--opengl-shaders=<files>`` + Deprecated option for ``--opengl-shader``. Command line parsing behaves + slightly diffent. ``--opengl-shader-set`` gives exactly the same behavior. + ``--deband`` Enable the debanding algorithm. This greatly reduces the amount of visible banding, blocking and other quantization artifacts, at the expensive of @@ -4999,6 +5015,8 @@ Miscellaneous does not cause default stream selection over the "proper" file. This makes it slightly less intrusive. + This is a list option. See `List Options`_ for details. + ``--autoload-files=<yes|no>`` Automatically load/select external files (default: yes). diff --git a/options/m_option.c b/options/m_option.c index 9403817ed8..ae63044e50 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1164,6 +1164,8 @@ static int str_list_del(struct mp_log *log, char **del, int n, void *dst) talloc_free(lst[idx]); lst[idx] = NULL; s--; + if (i > 0) + mp_warn(log, "Passing multiple -del arguments is deprecated!\n"); } talloc_free(del); @@ -1252,9 +1254,7 @@ static int parse_str_list_impl(struct mp_log *log, const m_option_t *opt, return 1; } - // custom type for "profile" calls this but uses ->priv for something else - char separator = opt->type == &m_option_type_string_list && opt->priv ? - *(char *)opt->priv : OPTION_LIST_SEPARATOR; + char separator = opt->priv ? *(char *)opt->priv : OPTION_LIST_SEPARATOR; int n = 0; struct bstr str = param; while (str.len) { diff --git a/options/m_option.h b/options/m_option.h index fc879d44f1..8489077627 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -579,14 +579,11 @@ extern const char m_option_path_separator; #define OPT_STRINGLIST(...) \ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list) -#define OPT_STRING_APPEND_LIST(...) \ - OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list) - #define OPT_KEYVALUELIST(...) \ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_keyvalue_list) #define OPT_PATHLIST(...) \ - OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list, \ + OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list, \ .priv = (void *)&m_option_path_separator) #define OPT_INT(...) \ diff --git a/options/options.c b/options/options.c index 3827709dcc..02dc5e94dd 100644 --- a/options/options.c +++ b/options/options.c @@ -289,7 +289,7 @@ const m_option_t mp_opts[] = { OPT_STRINGLIST("reset-on-next-file", reset_options, 0), #if HAVE_LUA || HAVE_JAVASCRIPT - OPT_STRINGLIST("script", script_files, M_OPT_FIXED | M_OPT_FILE), + OPT_PATHLIST("script", script_files, M_OPT_FIXED), OPT_KEYVALUELIST("script-opts", script_opts, 0), OPT_FLAG("load-scripts", auto_load_scripts, 0), #endif @@ -375,7 +375,7 @@ const m_option_t mp_opts[] = { #endif // demuxer.c - select audio/sub file/demuxer - OPT_STRING_APPEND_LIST("audio-file", audio_files, M_OPT_FILE), + OPT_PATHLIST("audio-file", audio_files, 0), OPT_STRING("demuxer", demuxer_name, 0), OPT_STRING("audio-demuxer", audio_demuxer_name, 0), OPT_STRING("sub-demuxer", sub_demuxer_name, 0), @@ -459,10 +459,10 @@ const m_option_t mp_opts[] = { // ------------------------- subtitles options -------------------- - OPT_STRING_APPEND_LIST("sub-file", sub_name, M_OPT_FILE), - OPT_PATHLIST("sub-paths", sub_paths, 0), - OPT_PATHLIST("audio-file-paths", audiofile_paths, 0), - OPT_STRING_APPEND_LIST("external-file", external_files, M_OPT_FILE), + OPT_PATHLIST("sub-file", sub_name, 0), + OPT_PATHLIST("sub-file-path", sub_paths, 0), + OPT_PATHLIST("audio-file-path", audiofile_paths, 0), + OPT_PATHLIST("external-file", external_files, 0), OPT_FLAG("autoload-files", autoload_files, 0), OPT_FLOAT("sub-delay", sub_delay, UPDATE_OSD), OPT_FLOAT("sub-fps", sub_fps, UPDATE_OSD), @@ -832,6 +832,10 @@ const m_option_t mp_opts[] = { OPT_REMOVED("fs-black-out-screens", NULL), OPT_REPLACED_MSG("loop", "loop-playlist", "--loop will be changed to map to" " --loop-file in future releases."), + OPT_REPLACED_MSG("sub-paths", "sub-file-path", + "passing multiple paths works differently now"), + OPT_REPLACED_MSG("audio-file-paths", "audio-file-path", + "passing multiple paths works differently now"), {0} }; diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index b158f03c12..d21a3d397a 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -375,7 +375,9 @@ const struct m_sub_options gl_video_conf = { ({"no", BLEND_SUBS_NO}, {"yes", BLEND_SUBS_YES}, {"video", BLEND_SUBS_VIDEO})), - OPT_STRINGLIST("opengl-shaders", user_shaders, M_OPT_FILE), + OPT_STRINGLIST("opengl-shaders", user_shaders_old, M_OPT_FILE, + .deprecation_message = "use --opengl-shader (1 for each file)"), + OPT_PATHLIST("opengl-shader", user_shaders, 0), OPT_FLAG("deband", deband, 0), OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0), OPT_FLOAT("sharpen", unsharp, 0), @@ -1645,6 +1647,7 @@ static void gl_video_setup_hooks(struct gl_video *p) }); } + pass_hook_user_shaders(p, p->opts.user_shaders_old); pass_hook_user_shaders(p, p->opts.user_shaders); } @@ -2989,6 +2992,8 @@ static bool check_dumb_mode(struct gl_video *p) return false; } } + if (o->user_shaders_old && o->user_shaders_old[0]) + return false; if (o->user_shaders && o->user_shaders[0]) return false; if (p->use_lut_3d) diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index 3b6533e0ef..55fd18461a 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -128,6 +128,7 @@ struct gl_video_opts { int interpolation; float interpolation_threshold; int blend_subs; + char **user_shaders_old; char **user_shaders; int deband; struct deband_opts *deband_opts; |