Commit Graph

1101 Commits

Author SHA1 Message Date
nanahi 9543426889 options: move dvd options to stream_dvdnav
The options and struct are only used in stream_dvdnav.c.
Also use dvd prefix for dvd_conf.
2024-11-18 17:22:02 +01:00
nanahi 8612f802dd options: move OSD bar opts to a separate struct
Move them to a suboption so the suboption prefix can be
used.
2024-11-18 17:22:02 +01:00
nanahi e056ad374f options: move mp_sub_filter_opts to sd_ass.c
Also use sub-filter common prefix.
2024-11-18 17:22:02 +01:00
nanahi f3b56c846d options: remove extra spaces 2024-11-18 17:22:02 +01:00
Guido Cella 476ed609ea options: increase the default --image-display-duration
1 second is too short to view images, so increase the default duration
to 5 seconds.
2024-11-13 14:15:16 +00:00
Olivier Perret 3bbc770b14 options: add .qoi to the list of image extensions 2024-11-08 10:01:28 +01:00
llyyr 22116734e7 sd_ass: introduce sub-ass-prune-delay
Disabled by default because it breaks sub-seek and playback in cases
where the user changes play-dir from + to - during runtime and past
"seen" events need to be re-rendered.

Available since dcc9eb722e
2024-11-03 05:23:41 +01:00
Kacper Michajłow 207aa647a5 options/m_option: free all list elements when removing them
Elements are not parented to the add list, as they are directly copied
to the target list. Therefore, we need to clean them up manually.

Fixes: 1f5a67d8fa
2024-11-02 04:24:00 +01:00
Kacper Michajłow 2054d872d4 m_property: stop expanding strings after 10 properties during fuzzing
Some properties, like `${decoder-list}`, are resource-intensive to
expand. Prevent fuzzing from generating strings with excessive
expansions to encourage shorter test cases.

Expanding properties on each playback frame for `osd-msg1` can be
demanding. However, in regular use cases, this typically isn’t an issue,
so implementing a caching solution wouldn’t be practical in real
scenarios.

Fixes timeouts on OSS-Fuzz.
2024-11-02 04:24:00 +01:00
Kacper Michajłow 1f5a67d8fa options/m_option: limit string list to 100 per operation for fuzzing 2024-11-02 01:40:41 +01:00
Kacper Michajłow 0a5d656c20 options: disallow log-file when fuzzing
To avoid leaving garbage files behind. It even managed to open log file
itself and stuck in infinite reading loop.
2024-11-02 01:40:41 +01:00
llyyr e28bfadbea options: remove stale comment about encoding mode being compiled-in
Encoding mode used to be a compile time option, but now it's always
compiled in.
2024-10-31 16:43:25 +01:00
nanahi c6883c4a56 options: add option to control OSD bar marker style
This adds --osd-bar-marker-style option which can be used to
customize OSD bar marker style. In addition to the existing triangle
style, a new style option is added to draw markers as lines.
2024-10-26 20:02:04 +02:00
nanahi ea8ac49f11 options: add options to control OSD bar marker size
This adds --osd-bar-marker-scale and --osd-bar-marker-min-size
options which can be used to customize OSD bar marker size.
2024-10-26 20:02:04 +02:00
Kacper Michajłow 153d4927ab options: add --script-opt alias for --script-opts-append 2024-10-22 18:54:16 +02:00
nanahi 607997db24 options/parse_configfile: use stream_read_file2 for reading config
Remove the duplication with stream_read_file2, which also handles
directory correctly.
2024-10-20 19:31:49 +02:00
Guido Cella a0ca6ed5d5 options: rename --load-osd-console to --load-console
OSD is not accurate since when the console gained support for printing
to the terminal.
2024-10-17 23:57:24 +02:00
Kacper Michajłow 3df68c5807 options: mark sub-lavc-o as UPDATE_SUB_HARD
To properly update lavc options it may be required to reinit sub
decoder, so mark this option as UPDATE_SUB_HARD.
2024-10-10 16:24:09 +02:00
Dudemanguy e01eab4385 win_state: move window centering to vo_calc_window_geometry
c4e8c36071 made any usage of --geometry
implicitly center the window on the screen after a resize even if the
user did not pass any x/y arguments to the option. At the time, this was
probably wanted since --geometry was primarily a startup option and
likely the window wouldn't be centered on x11 without moving
coordinates. Times have changed since then and we support full runtime
--geometry changes on all the relevant platforms but it comes with this
automatic window centering behavior (except on wayland of course hah).

It's better to make such window centering optional and user controllable
since it is entirely reasonable that someone wants --geometry=50% to
just resize and not move anything. It's already trivial for a person
that does want to move the window to just add their coordinates to the
--geometry command so there's no reason to continue to force this
behavior since it is less flexible.

Instead, move the window centering stuff out of m_geometry_apply into
vo_calc_window_geometry. We give the power to the caller to whether or
not to force centering the window here and all usage of the function is
updated to simply call it with false for now. Additionally,
--force-window-position being set will also center the window like
before. All that is left is for the windowing code to take advantage of
this. See subsequent commits.
2024-10-05 18:40:11 +00:00
Kacper Michajłow 7202406fe8 various: remove global.h inclusion where not needed 2024-10-01 12:23:44 +02:00
sfan5 c11239be8c options: enable handling --no-hwdec as --hwdec=no
Reusing M_OPT_ALLOW_NO has the side-effect of applying to --ab-loop-[ab],
which makes sense.
2024-09-30 11:26:13 +02:00
nanahi 53f2619dbd options: force --ab-loop-count and --loop-file notification
Since f411f3145b, these properties
no longer change with each loop. This however caused a regression
on the behavior of resetting loop count by resetting these
properties.

Previously, after the loop count is decreased, it is possible to
reset these properties back their original values and thus reset
the remaining loop count. Currently, because setting properties
has no effect if the new value is the same as the existing value
(which no longer changes), resetting these properties does nothing,
and remaining-*-loops (which are read-only) remain unchanged.
There is no way to reset them other than temporarily setting them
to a different value, which is awkward.

Fortunately, this can be fixed by marking these properties as
force_update, which always notifies changes when being set.
2024-09-26 22:48:52 +02:00
Dudemanguy 21a0fa7abe options: fix missing comma in default watch_later_options values
Missed in 207b1a2c91.

Fixes https://github.com/mpv-player/mpv/pull/14731#issuecomment-2358718766
2024-09-18 10:40:42 -05:00
Oneric 5357d18fe6 sub: add ass-video-aspect-override option
It is unclear whether there actually is any usecase for this option
which isn't better served by sub-ass-use-video-data and/or LayoutRes
overrides, but prior to the introduction of sub-ass-use-video-data
it was possible to pass along storage resolution while faking an
aspect ratio of 1:1.
sub-ass-video-aspect-override=1 combined with sub-ass-use-video-data=all
now makes this possible again.

The uper limit of a 10:1 aspect matches
the general video-aspect-override option.
2024-09-13 23:24:08 +02:00
Oneric 207b1a2c91 sub: merge vsfilter-aspect and vsfilter-blur-compat options
The naming for "blur-compat" was misleading since the setting
actually affects more than just blur affects. Additionally
forwarding storage resolution but forcing an aspect ratio
of 1.0 for the video is likely to result in odd rendering
and there’s no known usecase for it.

Both options control which video properties are exposed to libass
so to fix the aforementioned issues merge these settings into one
tri-state sub-ass-use-video-data.

The default V keybind now cycles through all states of
use-video-data instead of toggling vsfilter-aspect-compat.

Resolves: https://github.com/mpv-player/mpv/issues/10680
2024-09-13 23:24:08 +02:00
Kacper Michajłow 5edc8973eb various: use talloc_replace 2024-09-08 17:33:27 +02:00
Kacper Michajłow 44a3a3293f options: add --{video,audio,image}-exts 2024-08-10 23:27:40 +02:00
Mike Will 88885c0401 audio: add pitch-shifting feature
Uses resampling in tandem with a time-stretching audio filter to
change the audio's pitch while leaving its tempo intact.
2024-08-07 22:56:17 +02:00
Kacper Michajłow 5fed12e025 win32: add Media Control support
Add support for SystemMediaTransportControls interface. This allows to
control mpv from Windows media control ui.
2024-07-29 21:38:19 +02:00
nanahi bb0932a3ad input/ipc-win: support fd:// for --input-ipc-client
This makes --input-ipc-client work on Windows.

To use this feature, a parent process needs to create a connected named pipe,
wrap the server handle in a CRT fd, and then spawn mpv as a child process
with the fd as the --input-ipc-client parameter.
The process can then communicate through the client handle.

The named pipe must be created duplex with overlapped IO and inheritable
handles.
2024-07-29 21:00:48 +02:00
Kacper Michajłow 77f1083098 options/m_config_frontend: remove empty line from --show-profile
Follow-up after 127b6a3455.
2024-07-26 20:07:30 +02:00
Dudemanguy 3c7b6db205 options: move all wayland specific options to vo_opts
Unlike most other platforming backends, wayland has its own specific
sub_options struct. 027ca4fb85 originally
introduced this and some more options were added later, but in
retrospect it's an unneccesary complication. There are already x11,
and windows-specific options within vo_opts. In fact, there actually is
a wayland one in there already as well (wayland-content-type) so it's
split btween two places. The wayland code already has to handle vo_opts
and it is already handles callbacks if needed. There is no advantage to
having a separate wayland-specific sub_options struct which is stuck
with whatever you set at init time.

So solve everything by deleting the old sub_options struct, moving it to
vo_opts and make some minor option naming changes for clarity (i.e.
adding a 'wl_' in front of the name). This simplifies the wayland common
code and also makes it have more functionality since you get runtime
updates for free.
2024-07-24 18:46:04 +00:00
Guido Cella a5937ac7e3 m_option: add UPDATE_VO flag
This will allow reiniting the VO when more options are changed without
hardcoding them in options.c

Also reinit the VO when changing --gpu-debug and --gpu-sw.
2024-07-24 18:44:41 +00:00
Guido Cella d384a6b793 external_files: allow specifying --cover-art-whitelist filenames
Fixes https://github.com/mpv-player/mpv/discussions/14520.
2024-07-23 14:12:11 +00:00
Misaki Kasumi f2e7146cb1 sub: add (sub/osd)-border-style; renaming sub options 2024-07-12 20:17:38 +00:00
nanahi 7c70df0934 input/cmd: move m_option_type_cycle_dir to m_option.c
A relic when commands lived in input.c. Move them to where other option
types live. Also remove the redundant copy_opt.
2024-07-01 10:02:13 +02:00
Kacper Michajłow 95ac32220e m_option: parse the timestamp as unsigned value
The sign is handled manually. This allows us to skip the check for
negative integers.
2024-06-25 05:29:46 +02:00
Dudemanguy 6e3d90d72a options: remove some deprecated OPT_REPLACED option mapping
These were all deprecated in mpv 0.37.0 or earlier and are not
considered common enough options to warrant keeping the deprecated
mapping longer. Since demux_cue had only a single option in it, the
entire option substract is removed. This can be readded later if someone
wants to introduce a specific option to it again.
2024-06-25 02:18:58 +00:00
Dudemanguy 26029cfbb0 m_option: add a way for aliases to use sub option prefix
Previously, using m_option_type_alias required that the alias have the
full name of the option value. This is limited if you are reusing the
same opts struct in different sub options. Fix this by add an additional
field to m_option to signal whether or not prefixes should be taken into
account for the alias option. Instead of blindly using whatever is
stored in opt->priv as the name, we can construct the desired option
name for either case (using the prefix or not).
2024-06-24 12:51:28 +00:00
Kacper Michajłow 103cae2591 m_option: ignore excessive elements only for obj_settings_list
It makes sense to allow the first part of the list. There are
warnings about excessive elements already. This also allows overriding
elements with the same label.
2024-06-24 03:05:09 +02:00
Kacper Michajłow 2b056c89cd m_config_frontend: disallow profile=default in config files
profile=default in config file causes infinite recursion. It triggers
reload of the default config, which contains the profile=default...
2024-06-24 03:05:09 +02:00
nanahi f7ed8c42d2 options: add secondary-{sid,sub-delay} to watch_later_options 2024-06-23 05:05:22 +02:00
Kacper Michajłow 7fda885747 m_option: do float multiplication to avoid integer overflow
Huge values doesn't make much sense, but to avoid some arbitrary limits,
use double, as the output is already floating point value.

Found by OSS-Fuzz.
2024-06-23 02:33:04 +02:00
Kacper Michajłow 758019bf92 m_options: fix obj settings list leak on error
Fixes: b3b542af51
2024-06-23 02:33:04 +02:00
Dudemanguy 23ecfa9845 options: remove deprecated auto choice for --mute
Since 995c47da9a, setting --mute=auto has
been equivalent to --mute=no. It was formally documented later in
79e20ff485. This is an old legacy relic
and the auto choice popping up during auto completion could be confusing
to users who aren't aware of the history. Remove it for good and convert
the option to a proper boolean.
2024-06-21 21:29:33 +02:00
Kacper Michajłow b3b542af51 m_options: limit list entries to 100
Limit list entries to 100. obj_settings_list is not designed to hold
more items, and it quickly starts taking ages to add all items. 100 is
more than enough.

Fixes 30s timeout on OSS-Fuzz and generally fixes possible DoS on mpv.
2024-06-18 03:11:14 +02:00
Kacper Michajłow 783150722d m_options: fix mark_del leak on error
Found by OSS-Fuzz.
2024-06-18 03:11:14 +02:00
Misaki Kasumi c55ff4176c opengl: add --egl-output-format 2024-06-08 10:23:32 +02:00
Misaki Kasumi cd74f8f7c5 opengl: add --egl-config-id 2024-06-08 10:23:32 +02:00
Guido Cella dc998560aa options: add --osd-playlist-entry
Allow configuring whether to print the media-title, the filename or both
(as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist
and in the playlist selector.

Showing only titles hides information when files are badly tagged, or
when it hides the track numbers of album songs. But showing filenames is
not as useful as titles e.g. when playing URLs with media titles. This
option lets the user choose which one to show, or show both if switching
is inconvenient.

The OSC's playlist_media_title script-opt is removed because this option
is better since it works everywhere after configuring it once.

Closes #11653.

Also show the full URLs of playlist entries instead of their basenames
in osc.lua and select.lua, consistently with mp_property_playlist().

For simplicity, this just checks if entries contain :// instead of
replicating all of mp_is_url().

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-08 01:43:15 +02:00