summaryrefslogtreecommitdiffstats
path: root/options
Commit message (Collapse)AuthorAgeFilesLines
* demux_playlist: add option to control recursive directory loadingChristoph Heinrich2023-07-062-0/+3
| | | | | | | | | | | Directories were always loaded recursively, which can be slow (e.g. one of the subdirectories is a mounting point to a slow device) and can unexpectedly expand into a massive playlist. Due to the problems described in 503dada42f1ea1007768da0dc6a41b67cdf89400, this defaults to recursive loading. ref. https://github.com/mpv-player/mpv/issues/9652
* player: add --input-cursor-passthrough optionDudemanguy2023-07-042-0/+2
| | | | | | | | | | | | | Add an option for allowing pointer events to pass through the mpv window. This could be useful in cases where a user wants to display transparent images/video with mpv and interact with applications beneath the window. This commit implements this functionality for x11 and wayland. Note that whether or not this actually works likely depends on your window manager and/or compositor. E.g. sway ignores pointer events but the entire window becomes draggable when you float it (nothing under the mpv window receives events). Weston behaves as expected however so that is a compositor bug. Excuse the couple of completely unrelated style fixes (both were originally done by me).
* options: add no to drag-and-dropDudemanguy2023-07-011-2/+3
| | | | | Suggested by @sfan5. Naturally, "no" disables all drag and drop behavior.
* options: drop unnecessary castsNRK2023-06-301-3/+3
| | | | | | | | | | | | | | | | | | the reason for these casts are unknown but they were presumably to silence warnings 9 years ago. but it doesn't seem to be necessary nowadays, so just drop the casts and also drop the `const` from the compound literal type. some small technical notes: 1. while string literals aren't `const` in C, writing to them is undefined (do not ask me why). and so compilers will typically put string literals into read only section anyways, regardless of weather `const` was used in the source or not. so this shouldn't make any difference codegen wise. 2. making the array of pointers `const` on the other hand might affect codegen, eg: `(char *const []){...}`. however, that'd trigger a lot of discarded qualifier warnings.
* options: use designated initializerNRK2023-06-301-3/+1
| | | | | | | | shorter and more robust this way instead of inserting at an index by manually counting. the surrounding code also uses `[STREAM_*] = ..` so it's more consistent as well.
* sub: rewrite auto-forced-only supportrcombs2023-06-251-1/+0
| | | | | - No longer has a fake "option" used only internally (which didn't always get propagated properly) - Always overrideable during playback
* player: add more precise sub fallback optionsrcombs2023-06-252-0/+5
|
* options: default slang to autorcombs2023-06-251-0/+5
|
* options: set subs-with-matching-audio to off by defaultrcombs2023-06-251-1/+1
| | | | This means that subtitles won't be displayed unless the user asks for them
* player: add drag-and-drop optionDudemanguy2023-06-122-0/+4
| | | | | | | | | | | Some platforms (wayland) apparently have a lot of trouble with drag and drop. The default behavior is still the same which is basically obeying what we get from the window manager/compositor, but the --drag-and-drop option allows forcibly overriding the drag and drop behavior. i.e. you can force it to always replace the playlist or append at the end. This only implements this in X11 and Wayland but in theory windows and macos could find this option useful (both hardcode the shift key for appending). Patches welcome.
* path: handle URLs consistently in mp_basenameKacper Michajłow2023-06-011-6/+8
| | | | | Detect URLs and skip DOS path processing as it is likely to do unexpected thing when ":" is found.
* path: let configdir also override "cache" and "state" pathssfan52023-05-211-3/+13
| | | | | | | | | | This matches the behaviour that libmpv API clients expect better and prevents silent regressons with watch_later suddenly appearing in an entirely different path (or none at all in case of weird platforms*). Also added some comments for easier understanding. * Android
* path: simplify "cache" and "state" fallbacksfan52023-05-211-15/+8
| | | | Instead of having more global state just do it on-the-fly.
* player: use XDG_CACHE_HOME by defaultDudemanguy2023-05-091-1/+6
| | | | | | | | | | | | This adds cache as a possible path for mpv to internally pick (~/.cache/mpv for non-darwin unix-like systems, the usual config directory for everyone else). For gpu shader cache and icc cache, controlling whether or not to write such files is done with the new --gpu-shader-cache and --icc-cache options respectively. Additionally, --cache-on-disk no longer requires explicitly setting the --cache-dir option. The old options, --cache-dir, --gpu-shader-cache-dir, and --icc-cache-dir simply set an override for the directory to save cache files. If unset, then the cache is saved in XDG_CACHE_HOME.
* player: use XDG_STATE_HOME for watch_laterDudemanguy2023-05-091-14/+28
| | | | | | | | | | | | | | | | | | A pain point for some users is the fact that watch_later is stored in the ~/.config directory when it's really not configuration data. Roughly 2 years ago, XDG_STATE_DIR was added to the XDG Base Directory Specification[0] and its description, user-specific state data, actually perfectly matches what watch_later data is for. Let's go ahead and use this directory as the default for watch_later. This change only affects non-darwin unix-like systems (i.e. Linux, BSDs, etc.). The directory doesn't move for anyone else. Internally, quite a few things change with regards to the path selection. If the platform in question does not have a statedir concept, then the path selection will simply return "home" instead (old behavior). Fixes #9147. [0]: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/4f2884e16db35f2962d9b64312917c81be5cb54b
* path: expand internal path selection API to allow for additional typesDudemanguy2023-05-092-12/+13
| | | | | | | | Currently, nothing new is actually implemented but the idea is simply to just pass a type string all the way up from mp_find_user_file down to actually getting the platform path. This allows for selecting different directories besides the user's native config directory. See the next commit for an implementation.
* osdep: separate out macos paths from path-unix.cDudemanguy2023-05-091-1/+3
| | | | | | | | | | | macOS really has completely different path conventions that mpv doesn't take into account and it treats it just like any other old unix-like system. This means mpv enforces certain conventions on it (like all the XDG stuff) that doesn't really apply. Since we'd like to use more of this but at the same time not distrupt mac users even more, let's just copy and paste the current code to a new file, update the build and call it a day. This way, the paths of these two platforms can more freely diverge.
* options: read config file as streamThomas Weißschuh2023-04-292-33/+13
| | | | | This aligns the possible sources of config files other loaded data. For example `--input-conf`.
* various: fix typosHarri Nieminen2023-03-282-5/+5
| | | | Found by codespell
* options: enable scripts related opts also with cplugins.Oliver Freyermuth2023-03-181-1/+1
| | | | | | If an mpv build neither supports lua nor javascript, but only cplugins, the scripts options are still usable to select which cplugins to load.
* player: remove unittest optionDudemanguy2023-03-022-5/+0
| | | | | | | | | Since meson has its own unit testing system, let's rework mpv's tests so they integrate nicely with this. To prepare for this, start off by dropping the unittest option. Of course, this means that tests will no longer be supported in the waf build at all but it will be dropped anyway. Note that the tests option is preserved for the meson build. We will still make use of this in the future commits.
* player: add --auto-window-resize optionDudemanguy2023-03-022-0/+3
| | | | | | | | | | | mpv's window resizing logic always automatically resized the window whenever the video resolution changed (i.e. advancing forward in a playlist). This simply introduces the option to make this behavior configurable. Every windowing backend would need to implement this behavior in their code since a reconfigure event must always be a resize. The params of the frame changed so you either have to resize the window to the new size of the params or make the params the same size as the window. This commit implements it for wayland, win32, and x11.
* options: change parameter that was forgottin in property transitionChristoph Heinrich2023-02-272-3/+3
| | | | | 17d91b9d4d2d208f4a847395198cdbbcad18de93 changed the name, but not the parameter type and cast
* client API: reintroduce CONF_TYPE_FLAG for type conversionChristoph Heinrich2023-02-271-0/+2
| | | | | | | | | | Changing the CONF_TYPE_FLAG was a bad idea because mpv_node.u.flag continues to be an int, leading to a mismatch in type sizes which can lead to problems with memcpy(). ref. #11373 This partially reverts commit 17d91b9d4d2d208f4a847395198cdbbcad18de93.
* Partially revert "options: remove OPT_FLAG"Christoph Heinrich2023-02-271-0/+63
| | | | | | | | | | | The m_option_type_flag is still needed for the CONF_TYPE_FLAG (next commit). Add a comment that m_option_type_flag shouldn't be used. ref. #11373 This partially reverts commit 07545657bf73ebb4da38e26950d5203466298ec1.
* various: fix warning -Wimplicit-const-int-float-conversionThomas Weißschuh2023-02-261-1/+1
|
* options: remove explicit initialization of integers to 0Christoph Heinrich2023-02-211-4/+0
|
* options: remove OPT_FLAGChristoph Heinrich2023-02-212-65/+0
|
* options: transition properties from flag to boolChristoph Heinrich2023-02-213-7/+6
|
* options: transition options from OPT_FLAG to OPT_BOOLChristoph Heinrich2023-02-212-226/+223
| | | | | | c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
* various: drop unused #include "config.h"Thomas Weißschuh2023-02-203-6/+0
| | | | | | Most sources don't need config.h. The inclusion only leads to lots of unneeded recompilation if the configuration is changed.
* Vulkan: add configure check for VK_KHR_display extensionrcombs2023-02-201-0/+2
| | | | This allows building directly against ICDs that don't implement this extension.
* m_property: avoid using a small stack buffer in m_property_do_bstrrcombs2023-02-131-5/+4
| | | | This allows operations on properties with longer names (e.g. deeply-nested user-data sub-props).
* m_property: add M_PROPERTY_DELETErcombs2023-01-281-0/+5
|
* options/m_option: support duplicating MPV_FORMAT_BYTE_ARRAY nodesrcombs2023-01-281-0/+10
|
* drm: rewrite based around vo_drm_stateDudemanguy2023-01-212-10/+5
| | | | | | | | | | | A longstanding pain point of the drm VOs is the relative lack of state sharing. While drm_common does provide some sharing, it's far less than other platforms like x11 or wayland. What we do here is essentially copy them by creating a new vo_drm_state struct and using it in vo_drm and context_drm_egl. Much of the functionality that was essentially duplicated in both VOs/contexts is now reduced simple functions in drm_common. The usage of the term 'kms' was also mostly eliminated since this is libdrm nowadays from a userspace perspective.
* various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriatesfan52023-01-121-1/+1
| | | | | | | | In debug mode the macro causes an assertion failure. In release mode it works differently and tells the compiler that it can assume the codepath will never execute. For this reason I was conversative in replacing it, e.g. in mpv-internal code that exhausts all valid values of an enum or when a condition is clear from directly preceding code.
* player: don't force saving start in watch-later-optionsDudemanguy2023-01-091-0/+1
| | | | | | | | | | | | The watch-later mechanism has always unconditionally wrote start to files to save the playback position. When this was later expanded to watch-later-options, this logic was kept in place. But we don't actually have to unconditionally write this and can allow users to remove the option from the list if they want to. The start value still requires some special handling; it should always be written if possible regardless of the value changing. However, we can just place it within the default set of options for watch-later-options so it can be removed like any other.
* player: add video-sync=display-tempoChristoph Heinrich2023-01-091-0/+1
| | | | | | | | So far there was no way to sync video to display and have audio sync to video without changes in pitch. With this option the audio does not get resampled (pitch change) and instead the corrected audio speed is applied to audio filters.
* wayland: add support for content-type protocolDudemanguy2022-11-152-0/+6
| | | | | | | | | | | | | | | | | | | | The content-type protocol allows mpv to send compositor a hint about the type of content being displayed on its surface so it could potentially make some sort of optimization. Fundamentally, this is pretty simple but since this requires a very new wayland-protocols version (1.27), we have to mess with the build to add a new define and add a bunch of if's in here. The protocol itself exposes 4 different types of content: none, photo, video, and game. To do that, let's add a new option (wayland-content-type) that lets users control what hint to send to the compossitor. Since the previous commit adds a VOCTRL that notifies us about the content being displayed, we can also add an auto value to this option. As you'd expect, the compositor hint would be set to photo if mpv's core detects an image, video for other things, and it is set to none for the special case of forcing a window when there is not a video track. For completion's sake, game is also allowed as a value for this option, but in practice there shouldn't be a reason to use that.
* player: add --force-render optionDudemanguy2022-11-152-0/+2
| | | | | | | | mpv has an internal optimization on a couple of platforms where it will not render any frames if the window is minimized or hidden. There's at least once possible use case for wanting to force a render anyway (screensharing with pipeware) so let's just add a simple switch for this that always forces mpv to render. Closes #10846.
* options: log profile name if there is no restore dataNatural-Harmonia-Gropius2022-10-281-1/+1
|
* x11: add --x11-present optionDudemanguy2022-06-222-0/+4
| | | | | | | | | | | With the recent addition of the libxpresent, it should improve frame timings for most users. However, there were known cases of bad behavior (Nvidia) which lead to a construction of a whitelist instead of just enabling this all the time. Since there's no way to predict whatever combination of hardware/drivers/etc. may work correctly, just give users an option to switch the usage of xorg's presentation statistics on/off. The default value, auto, works like before (basically, Mesa drivers and no Nvidia are allowed), but now one can force it on/off if needed.
* various: fix typosCœur2022-04-251-1/+1
|
* options: make --cover-art-auto=exact the defaultGuido Cella2022-04-211-1/+1
| | | | | | | | | Now that a separate --cover-art-whitelist option exists, files like cover.jpg are loaded even without setting --cover-art-auto to fuzzy, so only load files that have exactly the media filename by default, since fuzzy loading is probably more likely to load unwanted images than to load cover art that the user intended to display, especially if you play audio files with a short filename like a.mp3.
* player: add cover-art-whitelist optionGuido Cella2022-04-212-0/+3
| | | | | | | | This allows more fine grained control over which cover art to load. With --cover-art-auto=exact and --cover-art-whitelist=yes, you can now load cover art with the exact media filename and the whitelisted filenames, but not cover art that contains the media filename (--cover-art-auto=fuzzy).
* player: rearrange video sync opts/enums/definesDudemanguy2022-04-112-10/+10
| | | | | | | | | | | | | | | | | The video sync logic for mpv lies completely within its core at essentially the highest layer of abstraction. The problem with this is that it is impossible for VOs to know what video sync mode mpv is currently using since it has no access to the opts. Because different video sync modes completely changes how mpv's render loop operates, it's reasonable that a VO may want to change how it renders based on the current mode (see the next commit for an example). Let's just move the video sync option to mp_vo_opts. MPContext, of course, can still access the value of the option so it only requires minor changes in player/video.c. Additionally, move the VS_IS_DISP define from to player/core.h to common/common.h. All VOs already have access to common/common.h, and there's no need for them to gain access to everything that's in player/core.h.
* options: add osd-playing-msg-durationGuido Cella2022-04-072-0/+3
|
* options: add always to stop-screensaverDudemanguy2022-02-181-1/+5
| | | | | | | | | | The stop-screensaver option is currently limited to a simple yes/no option. While the no option does always disable mpv trying to stop the screensaver, yes does not mean the screensaver is always stopped. The screensaver will be enabled again depending on certain conditions (like if the player is paused). Simply introduce a new value for this option, always, which does exactly what the name implies: the screensaver will always be disabled.
* Revert "options: add --sub-visibility=<primary-only|secondary-only>"Avi Halachmi (:avih)2022-01-192-5/+4
| | | | | | | | | | This reverts commit 04f0b0abe48d664aaa1400d1dddb02b434999b85. It's not a good idea to unify the names only for visibility, while keeping secondary-* for everything else. This needs a bit more thought before we allow secondary sub to be visible on its own.
* options: add --sub-visibility=<primary-only|secondary-only>Ripose2022-01-192-4/+5
| | | | | | | | | | | | | Adds --sub-visibility choices 'primary-only' for only displaying the primary subtitle track, and 'secondary-only' for only displaying secondary subtitle track. Removes --secondary-sub-visibility and displays a message telling the user to use --sub-visibility=yes/primary-only instead. These changes make it so that the default 'sub-visibility' bind 'v' cycles through all the 'sub-visibility' choices, 'no', 'yes', 'primary-only', and 'secondary-only'.
* options: const annotate all m_opt_choice_alternatives accessorsEmil Velikov2021-11-152-15/+16
| | | | | | | Constant data, most accessors are good but some were missing the explicit notation. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* options: const annotate m_obj_list accessorsEmil Velikov2021-11-151-1/+1
| | | | | | | Nearly all the code base correctly references the data as constant. But a couple of instances - fix those. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* options: remove always true m_obj_list::allow_unknown_entriesEmil Velikov2021-11-152-6/+1
| | | | | | | Ever instance of m_obj_list is a constant and for all of them, the field is true. Just remove the field all together. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* osdep: rename MP_UNREACHABLENiklas Haas2021-11-032-2/+2
| | | | | It was pointed out on IRC that the name is misleading, since the actual semantics of the macro is to assert first.
* osdep: add MP_UNREACHABLENiklas Haas2021-11-032-2/+2
| | | | | | | | | This seems to work on gcc, clang and mingw as-is, but I made it conditional on __GNUC__ just in case, even though I can't figure out which compilers we care about that don't export this define. Also replace all instances of assert(0) in the code by MP_UNREACHABLE(), which is a strict improvement.
* vo_gpu: lift ra_ctx_* opts to a global structNiklas Haas2021-11-032-0/+3
| | | | So I can re-use them for vo_gpu_next.
* options: add missing dash in msg-level help messageEmil Velikov2021-10-031-1/+1
| | | | | | | | Currently using mpv --msg-level=help, shows an instance of --msglevel (missing dash). Seems like the help message was only partially updated with the -msglevel -> --msg-level transition. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* sub: sub-filter-regex and jsre: support ass-to-plaintextAvi Halachmi (:avih)2021-08-052-0/+2
| | | | | | | | | | | Using --sub-filter-regex-plain (default:no) The ass-to-plaintext functionality already existed at sd_ass.c, but it's internal and uses a private buffer type, so a trivial utility wrapper was added with standard char*/bstr interface. The plaintext can be multi-line, and the multi-line regexp flag is now always set, but only affects plaintext (the ASS source is one line).
* sub: new: --sub-filter-jsre (js regex)Avi Halachmi (:avih)2021-08-052-0/+2
| | | | | | | | | | | | Pretty much identical to filter-regex but with JS expressions and requires only JS support. Shares the filter-regex-* control options. The target audience is Windows users - where filter-regex doesn't work due to missing APIs, but mujs builds cleanly on Windows, and JS is usually enabled in 3rd party Windows mpv builds. Lua could have been used with similar effort, however, the JS regex syntax is more extensive and also much more similar to POSIX.
* options: don't always set set-locally to trueGuido Cella2021-08-031-2/+1
| | | | | | | | | |