summaryrefslogtreecommitdiffstats
path: root/options
Commit message (Collapse)AuthorAgeFilesLines
* path: don't override "cache" and "state" paths with configdirsfan52023-10-021-10/+0
| | | | | | | | | | This reverts commit 576e86bfa18a0a79e591988ad93ed009edc40849 (functionally). Right now, the --config-dir option silently causes all watch_later and cache files to be written in the --config-dir as well. This is pretty uninitutive and also not desirable in most cases so get rid of this. libmpv users will have to set the corresponding options or env vars if they want to keep the old behaviour.
* win32: add option to change backdrop styleDeadSix2023-09-272-3/+13
|
* m_config_core: remove mp_read_option_rawDudemanguy2023-09-222-39/+0
| | | | | With the previous series of commits, all usage of this bad function has been eliminated in mpv so we can just nuke it for good.
* cuda: move --cuda-device to cuda_opts groupDudemanguy2023-09-222-2/+22
| | | | Also change a ta_free to talloc_free for consistency reasons.
* opengl/context_win: move opengl-dwmflush to wingl_opts groupDudemanguy2023-09-222-4/+3
| | | | Gets rid of yet another mp_read_option_raw call.
* options: rename some opt structs to *_opts instead of *_paramsDudemanguy2023-09-221-3/+3
| | | | | | Purely cosmetic, but this weird inconsistency bothered me. There's techincally vd_lacv_params and ad_lavc_params too, but encode is special and maybe shouldn't exist so we'll just leave that alone.
* stream_bluray: move --bluray-device to stream_bluray_optsDudemanguy2023-09-222-1/+3
| | | | | | Similar to the previous commit. There's no reason for --bluray-device to be in MPOpts. Make a specific subopt for stream_bluray and use that instead so we can remove the mp_read_option_raw call.
* stream_cdda: move cdrom-device to cdda_paramsDudemanguy2023-09-222-2/+1
| | | | | | There is zero reason for this to be an MPOpt. Because of how the OPT_SUBSTRACT works, the option gets renamed to cdda-device instead, but probably not a big deal since the old alias is still in place.
* options: move some demux-specific opts to demux optsDudemanguy2023-09-222-13/+0
| | | | | These options are only ever accessed by the demuxer and have no need to be in MPOpts. Move them to demux.c instead.
* win32: add --window-cornersKacper Michajłow2023-09-212-0/+12
| | | | Allows to set preference for window corners rounding for DWM.
* win32: add an option to control window title bar stateKacper Michajłow2023-09-212-0/+3
| | | | Fixes: #11432
* win32: add an option to change window affinityDeadSix2023-09-212-0/+3
|
* options: remove --vf-defaults and --af-defaultsDudemanguy2023-09-214-18/+4
| | | | | | | These were deprecated a long time ago and apparently didn't even work with lavfi filters. Go ahead and remove them and additionally clean up some code related to them. m_config_from_obj_desc_and_args becomes much simpler now and a couple of arguments can be completely removed.
* options: remove deprecated --record-file optionDudemanguy2023-09-212-4/+0
| | | | | | No wonder wm4 wanted to get rid of this. This option requires touching a bunch of crap in the core player code. --stream-record works perfectly fine and is a lot nicer so there's no need for this to exist anymore.
* options: remove a few options marked with .deprecation_messageDudemanguy2023-09-212-4/+0
| | | | | | | | | | | A bit different from the OPT_REPLACED/OPT_REMOVED ones in that the options still possibly do something but they have a deprecation message. Most of these are old and have no real usage. The only potentially controversial ones are the removal of --oaffset and --ovoffset which were deprecated years ago and seemingly have no real replacement. There's a cryptic message about --audio-delay but who knows. The less encoding mode code we have, the better so just chuck it.
* options: remove ancient option fallbacks/deprecationDudemanguy2023-09-212-121/+0
| | | | | | | | | | | | | We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting around in the code. This is harmless, but the vast majority of these are ancient. 26f4f18c0629998a9b91e94722d166866d8b80a3 is the last commit that touched the majority of these and of course that only changed how options were declared so all of this stuff was deprecated even before that. No use in keeping these, so just delete them all. As an aside, there was actually a cocoa_opts but it had only a single option which was replaced by something else and empty otherwise. So that entire thing was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were added in 0.35 or later were kept as is.
* options: make video-crop validation more strictKacper Michajłow2023-09-201-7/+9
|
* Revert "sub: add auto option to --sub-fix-timing"Kacper Michajłow2023-09-112-4/+2
| | | | This reverts commit b47a58516af2c36e66c3987748b5b4a1275ed9e7.
* m_option: return empty rect when no width/height is availableKacper Michajłow2023-09-081-0/+2
|
* m_option: make m_rect_apply center basedKacper Michajłow2023-09-082-10/+6
| | | | | | | | | This makes it easier to apply crops without need to manually calc the offset. I wanted for it to be top-left corner based, but maybe it was not that good idea in retrospect. Also rename scrw/scrh, since they don't refer to screen. It was copied form m_geometry apply.
* sub: add auto option to --sub-fix-timingDudemanguy2023-09-072-2/+4
| | | | | | | | | Third try is the charm? I stupidly missed that this option already existed in my previous commits. Instead, add an auto value to it and enable it by default for sd_lavc but not sd_ass. On my limited samples, it seems to fix the gaps issue that can occur but without regressing some duration timings for sub_lavc subtitles. Well hopefully anyway. Fixes #12327.
* options: remove unnecessary clamping on video-pan-x/yllyyr2023-09-021-2/+2
| | | | | This makes panning impossible at zoom level below 0, because it scales with 2^zoom. Allow using bigger values instead
* vo: add --video-cropKacper Michajłow2023-08-312-0/+3
| | | | | | Just cropping by VO that works with hwdec. Fixes: #12222
* m_option: add OPT_RECTKacper Michajłow2023-08-312-0/+64
| | | | Parsed as WxH+X+Y to mp_rect. Allows also WxH without the offset.
* player: rename --sub-forced-only to --sub-forced-events-onlyDudemanguy2023-08-292-2/+3
| | | | | | | | The old name is pretty bad and users mistakenly think it has something to do with selecting forced subtitles (that would be --subs-fallback-forced). Instead of giving it such a generic name, make it clearer that this has to do specifically with forced sub events which is only relevant for a small minority of subtitles.
* player: remove auto choice from sub-forced-onlyDudemanguy2023-08-292-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, this never worked. Or if it ever did, it was in some select few scenarios. c9474dc9ed6172a5f17f66f4b7d367da6b077909 is what originally added support for the auto choice. However, that commit worked by propagating a value to a fake option used internally. This shouldn't have ever worked because the underlying m_config_cache was never updated so the value shouldn't have been preserved when accessed in sd_lavc. And indeed with some testing, the value there is always 0 unsurprisingly. This was later rewritten in ba7cc071068f4f57ae354e77f64552712fda6855 along with a lot of other sub changes, but with that, it was still mostly broken. The reason is because one of the key parts of having to hit this logic (prefer_forced) required `--no-subs-with-matching-audio` to be set. If the audio language matches the subtitle language (the requirement also excludes forced subs), the option makes no subtitle selection in the first place so pick->forced_only_def is not set to true and nothing even happens. Another way around this would be to attempt to change your OS language (like with the LANG environment variable) so that the subtitle track gets selected but then audio_matches mistakenly becomes false because it compares the OS language to the audio language which then make preferred_forced 0, so nothing happens. I don't think there's a scenario where pick->forced_only_def is actually set to true (thus meaning `auto` is useless), but maybe someone could contrive something very strange. Regardless, it's definitely not something even remotely common. fbe8f9919428a7ed24a61899bfd85bbb7680e389 changed track selection again but didn't consider this particular case. The net result is that DVD/PGS subs become equivalent to --sub-forced-only being yes, so this a change in behavior and probably not a good one. Note that I wasn't able to actually observe any difference in a PGS sample. It still displayed subtitles fine but that sample probably didn't have the right flags to hit the sub-forced-only logic. Anyways, the auto feature is extremely questionable at best and in my view, not actually worth it. It is meant to be used with `--no-subs-with-matching-audio` to display forced pictures in subtitle tracks that are not marked as forced, but that contradicts that particular option's purpose and description in the manual (secretly selecting a track under certain conditions even though it says not to). Instead of trying to shove all this logic into select_default_track which is already insanely complicated as it is, recognize that this is a trivial lua script. If you absolutely want to turn --sub-forced-only on under these certain conditions (DVD/PGS subtitles, matching audio and subtitle languages, etc.), just look at the current-tracks property and do your thing. The very, very niche behavior that this option tried to accomplish basically never worked, no user even knows what this option does, and well it's just not worth supporting in core mpv code. Drop all this code for sanity's sake and change --sub-forced-only back to a bool.
* player: add always to --subs-fallback-forcedDudemanguy2023-08-282-3/+4
| | | | | | In general, forced tracks should only be shown if they match the language of the audio. However some people do want them no matter what, so add an always option to this so such tracks are always selected.
* player: add --subs-match-os-language optionDudemanguy2023-08-282-0/+3
| | | | | | | This is the replacement for the previous auto option for slang. It behaves similar however it never overrides slang if that is set and will instead try to pick the subtitle that matches the user's language if appropriately flagged by the file.
* player: remove special auto option from alang/slang/vlangDudemanguy2023-08-281-3/+0
| | | | | | | | | | | | This proved to be too problematic. Depending on the value of --subs-with-matching-audio, you could either end up with cases where --slang wasn't respected and users didn't get subtitles or alternatively cases where subtitles were given and the user didn't ask for them. Fundamentally, the OS language functionality doesn't really map well to slang (and for alang/vlang it makes zero sense; not that anyone actually used it). Instead of trying to shove it in an option where it doesn't belong, we should split this off into something else. So for now, just remove the special handling of "auto" and flip slang back to NULL.
* player: always write redirect entries for resuming playbackGuido Cella2023-08-282-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 35f43dfacbe added a system to write resume files for redirects, i.e. directories and playlists that mpv expands. It creates a resume file for each redirect, and for the first redirect only, it writes a resume file for each segment of its path, without even converting it to an absolute path if it's relative. This is incomplete: mpv 'Iron Maiden/1982 The Number of the Beast/8 Hallowed Be Thy Name.mp3' This doesn't save any redirect entry. mpv --directory-mode=recursive 'Iron Maiden', then quit-watch-later on Hallowed Be Thy Name This saves a redirect entry for "Iron Maiden", but not for "1982 The Number of the Beast". It doesn't save redirect entries for the directories above "Iron Maiden" either because "Iron Maiden" isn't converted to an absolute path. In both of these cases mpv --directory-mode=lazy 'Iron Maiden' won't resume from "Hallowed Be Thy Name" because "1982 The Number of the Beast" isn't the first subdirectory and there is no redirect entry for it. 503dada42f made mpv recursively expand subdirectories precisely to fix this, and f266eadf1e added back an option not to expand them. But if we fix how redirect entries are stored, we can make the superior --directory-mode=lazy (because it's faster and doesn't result in massive playlists) the default, and also ensure that mpv will resume playback even when you quit-watch-later a file without redirects and then play the directories above it. Fix this by always creating redirect entries for all segments of the absolute path of the file, so that both mpv 'Iron Maiden/1982 The Number of the Beast/8 Hallowed Be Thy Name.mp3' and mpv --directory-mode=lazy 'Iron Maiden' will create redirect entries for /$USER /$USER/music /$USER/music/Iron Maiden /$USER/music/Iron Maiden/1982 The Number of the Beast making mpv --directory-mode=lazy "Iron Maiden" resume from "Hallowed Be Thy Name". This commit also makes mpv delete the redirect entries of parent directories when resuming playback, because if for example you have a playlist with all the songs in a discography: 1980 Iron Maiden/1 Prowler.mp3 1980 Iron Maiden/2 Remember Tomorrow.mp3 ... 1981 Killers/1 The Ides of March.mp3 1981 Killers/2 Wrathchild.mp3 ... Now mpv will eventually create redirect entries for every album. If you later decide to play the directories instead and there are 20 albums, you would have to do mpv * 20 times to clear all the redirect entries.
* player: make all autoload extensions configurableDudemanguy2023-08-263-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | --audio-file-auto, --cover-art-auto, and --sub-auto all work by using an internally hardcoded list that determine what file extensions get recognized. This is fine and people periodically update it, but we can actually expose this as a stringlist option instead. This way users can add or remove any file extension for any type. For the most part, this is pretty pretty easy and involves making sub_exts, etc. the defaults for the new options (--audio-file-auto-exts, --cover-art-auto-exts, and --sub-auto-exts). There's actually one slight complication however. The input code uses mp_might_be_subtitle_file which guesses if the file drag and dropped file is a subtitle. The input ctx has no access to mpctx so we have to be clever here. For this, the trick is to recognize that we can leverage the m_option_change_callback. We add a new flag, UPDATE_SUB_EXTS, which fires when the player starts up. Then in the callback, we can set the value of sub_exts in external_files to opts->sub_auto_exts. Whenever the option updates, the callback is fired again and sub_exts updates. That way mp_might_be_subtitle_file can just operate off of this global variable instead of trying to mess with the core mpv state directly. Fixes #12000.
* x11: add --x11-wid-title optionDudemanguy2023-08-132-0/+2
| | | | | | | | | | This deliberately wasn't being done when mpv was embedded (fbccddb48b4c71c18300b092ef7a3860be2a659a). There are some applications that would benefit from mpv setting a title since they don't do so themselves (such as tabbed), but at the same time some others would probably rather not have this behavior (like smplayer). Add an option that allows an embedded mpv to set the title if the user wishes. Fixes #11528.
* player: add playlist-path propertiesDudemanguy2023-08-131-1/+3
| | | | | | | | | | | | A bit of a long standing pain with scripting is that when opening a file that gets interpreted as a playlist (like an m3u), the original path of the file gets thrown away later. Workarounds basically consist of getting the filename before mpv expands the path, but that's not really reliable. Instead of throwing it away, save the original playlist path by copying to the playlist entries when applicable (demuxer playlist and the playlist option). Then expose these as properties: playlist-path for the currently playing entry and playlist/N/playlist-path for each specific entry. Closes #8508, #7605.
* player: add --term-remaining-playtime optionDudemanguy2023-08-132-0/+3
| | | | | | | The OSC reports the speed-adjusted remaining time, but the terminal does not. This is a weird mismatch and the OSC's default behavior makes sense, so let's just do some division and add an option to disable it. Also named "remaining-playtime" after the OSC option. Fixes #10445.
* player: make sub-pos a float valueDudemanguy2023-08-132-2/+2
| | | | | | | | mpv makes this option an integer, but the underlying ass API actually accepts doubles. From some testing, there is no meaningful precision difference between float or double (it seems to go in roughly 0.05 steps), so just make it a float. sd_lavc also can handle non-integer values here. Closes #11583.
* m_option: change m_option_type_aspect to doubleDudemanguy2023-08-092-27/+27
| | | | | | | | | | | | | This specific option type is only used for the video aspect. The underlying type was a float to represent the inputted value, but it's actually not precise enough. When using something like 4:3, the values of the incorrect digits are actually significant enough to make av_d2q return a very funky numerator and denominator which is close to 4/3 but not quite. This leads to some "off by one pixel" errors. Weirdly, mpv's actual calculations for this were already being done as double, but then converted to floats for this specific type. Just drop the conversion step and leave it all as double which has the precision we need (i.e. AVRational is now 4/3 for the this case). Fixes #8190.
* options: fix relative time parsingm154k12023-08-061-0/+11
| | | | | | | | | | Currently relative time parsing is buggy when any of the non-leading units are non zero. For example, "-1:30" should result in -90 but currently it results in -30 (as a result of `-60 + 30`). Also reject timestamps where non-leading units are out of range. E.g. "1:100" would be rejected, but "100" will still be accepted as 100 seconds.
* options: rename variables in parse_timestringm154k12023-08-061-9/+10
|
* options: restore old default sub selection behaviorDudemanguy2023-07-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 1669c4698d237eb885aa3f9c5b81983de6009418 notably flipped the default of --subs-with-matching-audio from yes to no as part of a series of changes that gave more control over sub selection behavior. While the increased amount of options is definitely nice, changing the default to no results in very unintuitive behavior. For example, setting alang=en and slang=en in your config will not show any subtitles since the audio stream is English as well so --subs-with-matching-audio being no causes the subs to not be be selected. This is very weird for users who reasonably expect slang being set to actually result in showing subs and this is what mpv did for the past decade. The other case is when a subtitle does not have a language tag but is flagged as default. Because --subs-fallback (a new option), defaults to no, these subtitles also will not be loaded. This is also strange for users since mpv previously loaded these and they would need to change the value of this option. It's also inconsistent because audio tracks that are tagged as default are also loaded by default. The new behavior seems to have mostly just confused users, and it also regresses their configs for unclear reasons. Let's just set the options to be back in line with the old behavior with is what most users expect. --subs-with-matching-audio goes back to being yes and the new option --subs-fallback should be default. Fixes #11854.
* 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 defaultDudemanguy