Commit Graph

53216 Commits

Author SHA1 Message Date
nanahi 1818c423da .github/ISSUE_TEMPLATE: unify source of mpv description 2024-11-06 18:00:42 +01:00
nanahi c9bc1e6cfe .github/ISSUE_TEMPLATE: clarify the template is for other platforms
It currently says "different" issue which is unclear.
Clarify this by saying it's for other platforms.
2024-11-06 18:00:42 +01:00
llyyr 168fb56fe8 osc.lua: observe playlist-count instead of playlist property
Observing playlist property with "native" type is too expensive for
larger playlists, and we only observe this property to
activate/deactivate next/prev buttons on the osc. We actually only need
to know if the playlist-count has changed, nothing else.

Fixes: https://github.com/mpv-player/mpv/issues/15264
2024-11-06 18:00:09 +01:00
der richter 91d4e6f937 mac/type: change never mutated variable to let 2024-11-05 18:34:15 +01:00
der richter c80757d782 videotoolbox: silence OpenGL deprecation warnings 2024-11-05 18:34:15 +01:00
der richter 84adbd9d35 ao_coreaudio: fix CoreAudio deprecations 2024-11-05 18:34:15 +01:00
der richter 6f009a91a6 mac/common: fix light sensor deprecations 2024-11-05 18:34:15 +01:00
Dudemanguy 23843b4aa5 vo_gpu_next: set --target-colorspace-hint to `yes` by default
It simply does not make any sense to not signal the correct colorspace
and metadata by default.
2024-11-04 19:35:28 +00:00
Dudemanguy d5f1cd07dc vo_gpu_next: add a pass_colorspace override for drm
The libplacebo colorspace hint api makes sense for things like vulkan,
but for other APIs like drm that are capable of directly handling
colorspaces and hdr metadata it's a nuisance. Add a pass_colorspace fns
that signals to vo_gpu_next that the backend doesn't need the color
information to be manipulated and can handle the metadata itself.
2024-11-04 19:35:28 +00:00
Dudemanguy ca31b94843 wayland: guard devices_are_equal completely
Only used if we have drm. Avoids a -Wunused-function error.
2024-11-04 19:35:28 +00:00
Dudemanguy c0f1954d66 github/workflows: install libdisplay-info on freebsd
Needed for drm to build now.
2024-11-04 19:35:28 +00:00
Dudemanguy a4d9bdd262 drm: parse edid using libdisplay-info
libdrm unfortunately doesn't give us what is actually supported by the
connector in question. To do that, we would have to parse the edid blob.
Use libdisplay-info to do this and make it required for drm support.
Using what we get back from the library, we can do a bit of sanity
checking for hdr metadata to make sure that the display in question can
handle it before we try setting the metadata. Strictly speaking,
libdisplay-info has stuff for dynamic metadata that we could potentially
use, but as a first pass and for simplicity, only static is considered
for now.
2024-11-04 19:35:28 +00:00
Dudemanguy 8039128693 vo_gpu: explicitly set target_params to NULL on uninit
Prevents vo_get_target_params from segfaulting if called somewhere else
in the code since the underlying p->renderer was just freed.
2024-11-04 19:35:28 +00:00
Dudemanguy 2827c9f323 context_drm_gl: add support for hdr metadata
It seems what we can do on this level is a bit limited but it's better
than nothing. Closes #8219.
2024-11-04 19:35:28 +00:00
Guido Cella a61518db98 player/client: reduce log level for hooks not sent to clients
If a hook event can't be sent to a client because it no longer exists,
stop logging it as a warning, as there is no way for a client to remove
hooks, so it is expected that the hook can't be sent. This is documented
in libmpv/client.h.

If the hook event can't be sent for other reasons, like the event queue
being full (currently the only other possible reason), keep logging as
warning.

Also add the client and hook type to the message. They are also logged
just above, but only in verbose mode, so when only the warning is logged
you didn't see the client before.

auto_profiles.lua logs these warning since 5dc4047415, and this commit
fixes that.

Fixes #15244.
2024-11-03 20:03:49 +02: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
llyyr 9bf0c53763 sub/sd_ass: set ASS_OVERRIDE_BIT_BLUR if available
4df64d060a

Fixes: https://github.com/mpv-player/mpv/issues/14852
2024-11-03 05:12:34 +01:00
Kacper Michajłow b057af0a56 w32_common: update window style after changing maximized state
Maximized state is not allowed without WS_OVERLAPPEDWINDOW style and
doesn't stick. Set the style after.

Fixes: #15093
2024-11-03 02:21:15 +01:00
Kacper Michajłow 42ff6f92c3 vo_gpu_next: add chroma location and HDR metadata to shader parameters 2024-11-02 21:20:20 +01:00
Niklas Haas 89e608e169 vo_gpu_next: add dynamic hook parameters
Fixes: https://github.com/haasn/libplacebo/issues/230
Fixes: https://github.com/mpv-player/mpv/issues/8206
2024-11-02 21:20:20 +01:00
averne 32bcaf865b osdep/terminal: fix dummy implementation
c2ed2e7 introduced the terminal_set_mouse_input function to various terminal
backends, but overlooked the dummy backend.
This causes linking errors when trying to build on platforms with no terminal,
as vo_kitty and vo_tct are unconditionally enabled and make use of that
function.
2024-11-02 20:05:11 +01:00
Guido Cella a9d57938b2 .luacheckrc: add_hook is not undocumented
It's a commonly used function so group it with the documented functions.
2024-11-02 14:03:02 +02:00
Guido Cella 5dc4047415 auto_profiles.lua: actually exit when no auto profiles are defined
Unsetting _G.mp_event_loop at the top level quits the script, but not
within callbacks. Use the new exit() function instead. Fixes e2284fba18.

This actually has an edge case since e2284fba18 where you can add auto
profiles only later with load-config-file and the script stays unloaded,
but it's still reasonable to quit if mpv.conf has no conditional
profiles. You could always explicitly set --load-auto-profiles=yes in
this case.
2024-11-02 14:03:02 +02:00
Guido Cella bb0b9f4cc8 defaults.lua: add an exit() function
Scripts can terminate execution by setting mp.keep_running = false. Add
an exit() function to wrap setting mp.keep_running and properly expose
this feature. It can be used e.g. by a thumbnail script to spawn workers
with load-script and then let them quit.

It is not added to the mp namespace as mp.exit because that would make
it look like it terminates mpv.

This mirrors the exit() function which already exists in js.

The note in javascript.rst about having to remove key bindings before
exit is not kept because they are actually removed automatically since
bf385e1140 (though it was accurate when the JS backend was developed
before upstreaming it).
2024-11-02 14:03:02 +02:00
nanahi e734f5ae33 video/out/w32_common: don't move window if position isn't set
The geometry output of vo_calc_window_geometry does not have
any information about the current window position. This causes
the window to move when setting geometry even without setting
x/y.

Change it so that the window position is unchanged if x/y are not
set and after startup.
2024-11-02 11:14:57 +01:00
nanahi 512f5e2e82 video/out/w32_common: always move window when setting state
Make sure the window is at the correct position when
fullscreen while geometry is set.

Fixes: e5159de811
2024-11-02 11:14:57 +01:00
Kacper Michajłow d78c35d360 fuzzers/fuzzer_json: add simple fuzzing for our json code 2024-11-02 05:28:11 +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
Guido Cella 4def28ad0d DOCS/man/input: note that properties can be unavailable on init
It comes up often in IRC and issues that users don't understand why the
path property is initially unavailable, so link the section that
mentions it from the Properties section, and expand on how to get these
properties.
2024-11-02 01:41:11 +01:00
Guido Cella 6085261146 DOCS/man/input: remove duplicate paragraph
This is mentioned again below in Property list and it makes more sense
near the list of properties.
2024-11-02 01:41:11 +01:00
Guido Cella 680e7022ee DOCS/man/input: suggest normalize-path to get absolute paths
Because it is a bit shorter than calling
utils.join_path(working_directory, path), it gives you a canonical path,
and it doesn't concate working-directory before URLs.
2024-11-02 01:41:11 +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 bc9d982330 encode_lavc: fix memory leak on --ofopts=help
Found by OSS-Fuzz.
2024-11-02 01:40:41 +01:00
Kacper Michajłow e96bffe7a8 player/loadfile: limit playlist size to 10 for fuzzing
Fixes timeout on huge generated playlists, 10 is enough to test if it
works.
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
Kacper Michajłow eb16169b27 demux_playlist: add data:// to self-expanding protocols
Found by OSS-Fuzz.
2024-11-02 01:40:41 +01:00
Kacper Michajłow de42e11662 demux_edl: disallow nested edl to avoid infinite loop
Found by OSS-Fuzz.
2024-11-02 01:40:41 +01:00
nanahi 1a522b4a72 command: quote input key names in log 2024-11-02 01:39:15 +01:00
nanahi c5da7beaa6 command: use array index for checking first character 2024-11-02 01:39:15 +01:00
nanahi 081fc7e317 input: fix style 2024-11-02 01:39:15 +01:00
nanahi 1b9d070786 command: fix keybind command with sequence keys
The command is documented to use the same syntax as input.conf, but
it doesn't work with sequence keys because it uses
mp_input_get_key_from_name for checking key names, when it should
use mp_input_get_keys_from_string instead.

Fix this by using the correct function.
2024-11-02 01:39:15 +01:00
nanahi 56e2689894 command: add the ability to set comment for keybind command
This allows the keybind to have a comment field which can be
read from input-bindings, and displayed by e.g. stats.lua.
2024-11-02 01:39:15 +01:00
nanahi affa953dd4 DOCS/man/input.rst: fix keybind command keyword argument name
It's "cmd" rather than "command".
2024-11-02 01:39:15 +01:00
nanahi d97ba359d2 input: deduplicate mp_input_bind_key
It's just a copypaste of bind_keys with some params set to
hard coded values, so use bind_keys instead.
2024-11-02 01:39:15 +01:00
llyyr 5b946ac360 player: don't load encoding mode profile twice
Also move the loading of profiles and input section activation in one
place. Leaving this in mp_initialize has the drawback that encoding
section profile will overwrite options set by the user in the command
line, since it's set after the CLI options are parsed and processed.
mp_parse_cfgfiles happens before parsing the CLI, so loading the profile
there is better.
2024-10-31 16:43:25 +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
Guido Cella 00e223ccb6 console.lua: refine the hovered item calculation
Calculate the hovered item from the bottom of the screen where the
console is anchored. This is simpler and accurate because it accounts
for the fact that the empty line between the log and the input line
isn't as tall as a full line, for the exact height of an always visible
OSC bottombar, and for the empty top pixels present because the height
isn't an integer multiple of the font size.
2024-10-31 16:40:56 +01:00
Guido Cella e1680167fd console.lua: factor OSC margins before the bottom margin
OSC margins are relative to the whole height before subtracting the
bottom left margin.
2024-10-31 16:40:56 +01:00
Kacper Michajłow 41cff490ad drm: don't print extra newline on connectors/modes help 2024-10-30 11:49:22 +01:00