Commit Graph

53368 Commits

Author SHA1 Message Date
Kacper Michajłow
fe546c1841 w32_common: guard recursive call to mp_dispatch_queue_process
This is already done in WndProc, but the flag was not set if we exited
event loop and were processing mpv dispatch messages in fallback loop.

This fixes the case when Window is destroyed externally or otherwise
event loop fails for whatever reason. Calling vo_w32_uninit does call
DestroyWindow() through dispatch, which in turn calls WndProc, so we
need to guard recursive call.
2024-12-09 19:20:52 +01:00
Kacper Michajłow
4747865fef player/command: continue hook processing on errors
If a hook fails to invoke or a client has been removed during hook
processing, attempt to continue with the next hook if possible.

Before this commit, any failure during hook processing would cause the
hook processing to stop.

This issue can be reproduced when auto_profiles.lua registers an on_load
hook and exits afterward because no profiles are registered. In such a
state, the next hook would fail and not invoke.

There are many scenarios where a hook client may be broken,
unresponsive, or disabled, so it makes sense to continue processing
subsequent hooks.

The regression we observed was caused by e2284fba1 and 5dc404741, which
made auto_profiles.lua register hooks and then exit, leaving stale hooks
registered. However, the root cause is not limited to the
auto_profiles.lua case.

Fixes: #15465
2024-12-09 19:20:38 +01:00
Kacper Michajłow
e9af4092e9 player/configfiles: don't loop directory tree if not needed
If we already failed to generate fname, there is no need to try harder.
2024-12-09 19:20:25 +01:00
Kacper Michajłow
04eb51246f options: remove old compatibility definitions
This makes things more readable.
2024-12-09 19:19:50 +01:00
Kacper Michajłow
22bb5c2690 m_option: don't overlap UPDATE and M_OPT constant values
Fixes: e1d30c4c5a
2024-12-09 14:59:08 +01:00
Kacper Michajłow
baf528069a osdep/mac/meson.build: remove unused variables 2024-12-09 11:01:07 +01:00
Kacper Michajłow
8eea5902ba options/m_option: restore m_geometry_apply centering ability
This fixes geometry uses where it is expected to be centered. For
example this fixes video-crop option.

Fixes: e01eab4385
Fixes: #15398
2024-12-08 18:14:04 +01:00
Neko Asakura
8d20b72653 meson: use swiftc instead of swift for building 2024-12-07 14:27:16 +01:00
Guido Cella
90a7892545 DOCS/man/mpv: document that g-e selects disc titles
It is hard to discover otherwise.
2024-12-05 11:52:37 +01:00
Jan Ekström
1b1a8a3e4f demux_lavf: simplify replaygain export
* Early exit if there is no useful data in the AVReplayGain
  structure (FFmpeg does check that gain of at least one thing is
  not INT32_MIN, but leaves the peak unchecked so it can be zero).
* Less depth in the if structure.
2024-12-05 01:21:38 +01:00
Jan Ekström
1f86733bb3 demux_lavf: utilize side data getter for replaygain
This simplifies the code, not requiring a loop.

Moves the getter definition somewhat upwards to allow
for its usage in a function that was defined before it.
2024-12-05 01:21:38 +01:00
Misaki Kasumi
f75304957a io: support mp_make_wakeup_pipe on Windows 2024-12-05 01:20:31 +01:00
Kacper Michajłow
91f1f4ff43 demux_disc: add playlist filename to edition title if available 2024-12-04 14:51:53 +01:00
Kacper Michajłow
e9b5773bf9 stream_bluray: add STREAM_CTRL_GET_TITLE_PLAYLIST 2024-12-04 14:51:53 +01:00
Kacper Michajłow
de951c383b demux_disc: expose titles as editions
This allows to select DVD/Blu-Ray title easily. Titles are listed as
editions with their duration and number.

I wanted to include Angles also in this selection, but currently Angles
are not that well supported, so let's stick with titles and leave the
rest for the future changes.

We might migrate to lavf demuxer for DVD/Blu-Ray in the future, the mpv
implementation is rotted anyway.

Fixes #14586
2024-12-04 14:51:53 +01:00
Kacper Michajłow
d91eea20be stream_bluray: implement STREAM_CTRL_GET_TITLE_LENGTH 2024-12-04 14:51:53 +01:00
Kacper Michajłow
b594fc2d6c github/workflows: replace ruff-action with a maintained one
See: c413c59d2a
2024-12-04 14:48:37 +01:00
Guido Cella
78ee714fff console.lua: fix mp.input.get clients that don't specify completions
Actually update the rendered text when typing with an input.get client
that didn't specify a complete callback.

Fixes #15430, fixes 57b73f1af6.
2024-12-03 14:59:53 +01:00
Guido Cella
f7e6e30a49 aspect: add --video-recenter
This ignores --video-align-{x,y} when the video is smaller than the
window in the respective direction.

After zooming in, panning and zooming out, this is useful to recenter
the video in the window.

Unlike doing this by observing osd-dimensions in a script, this is done
before rerendering, so you don't see the image being rendered uncentered
for an instant after zooming out, before being rerendered centered.

Also update --video-align docs while at it.

This doesn't work well with --video-pan-{x,y} because you can move the
output rectangle far away from the image, and when zooming out pan is
abruptly reset to the center. It doesn't feel like natural like zooming
out after changing --video-align-{x,y}. So this commit doesn't set pan
to 0. Also this leaves a way to move scaled images within the window
even with --video-recenter.
2024-12-02 22:31:14 +01:00
Guido Cella
43f4568816 select.lua: select editions 2024-12-02 21:44:18 +01:00
Jan Ekström
17e62fcc61 demux/stheader: update lav_codecpar's comment
Was already being utilized by demux_raw, and now also created in
demux_mkv.
2024-12-02 21:03:21 +01:00
Jan Ekström
84ee84abb8 demux_mkv: propagate global stream side data via codecpar
The first AVPacket method has been deprecated in FFmpeg, and only
the HEVC decoder would read this information from there. The native
AV1 decoder as well as the libdav1d wrapper only support the newer
propagation method via codec context's side data. {ad,sd,vd}_lavc
call mp_set_avctx_codec_headers which copies the side data from
codecpar to codec context, so no changes are required on the
receiving end.
2024-12-02 21:03:21 +01:00
Jan Ekström
ba37142ba4 demux_lavf: stop global stream side data injection to AVPacket
This process has been deprecated since avformat 60.15.100 and
since avcodec 60.30.101 AV_PKT_DATA_DOVI_CONF has been read from
AVCodecContext's coded_side_data. Additionally, the HEVC decoder
is the only one which currently reads this side data from packets,
the native AV1 decoder as well as the libdav1d wrapper instead only
support the newer propagation method via codec context's side data.

How this currently is supposed to propagate is:
* demux_lavf copies the codec parameters into sh_stream's lav_codecpar.
* {ad,sd,vd}_lavc call mp_set_avctx_codec_headers that calls
  avcodec_parameters_to_context, which then sets global side data
  to the codec context.

As this logic is already in place, so no additional changes are required
for things to work and the deprecated function call can just be
cleaned up.

Ref: FFmpeg/FFmpeg@5432d2aaca
Ref: FFmpeg/FFmpeg@804be7f9e3
Ref: FFmpeg/FFmpeg@12e5116872
2024-12-02 21:03:21 +01:00
Guido Cella
063410fa04 console.lua: don't reinsert the next characters on complete
This avoids inserting the characters in front of the cursor again when
completing to text already in front of the cursor.

This is important after 2f271a92de made Enter automatically insert the
first completion.
2024-12-02 20:57:01 +01:00
Guido Cella
9d67fc28e2 console.lua: don't complete DLLs on Windows
run completion on Windows is slow because system32 contains thousands of
DLLs, so filter executables with an extension in PATHEXT.
2024-12-02 20:56:49 +01:00
Guido Cella
3053797e3c defaults.lua: remove outdated comment
A client's input sections are destroyed along with it since bf385e1140.
2024-12-02 20:51:24 +01:00
Guido Cella
1f1c30146c console.lua: complete executables after run 2024-12-01 19:28:22 +01:00
Guido Cella
43ff1c1af6 console.lua: complete filter labels for {a,v}f-command 2024-12-01 19:28:22 +01:00
Guido Cella
15e7a1184a console.lua: complete command flags 2024-12-01 19:28:22 +01:00
Guido Cella
220de247b8 console.lua: remove code repetition in complete() 2024-12-01 19:28:22 +01:00
der richter
11186374a0 mac/option: explicitly include and define type of global init variable
the mpv_global struct is a public struct defined in common/global.h. in
the case that this header is included directly or indirectly into our
swift bridging header, code that uses that struct as an OpaquePointer
will fail to build, because swift would now be aware of its actual type.

preemptively include the header and properly define the type to prevent
such errors in the future.

i also checked all other usages of OpaquePointers and this is the only
case where this is relevant.

See e1d30c4 and 4ff9f50 as reference
2024-12-01 19:25:37 +01:00
nanahi
0114281627 DOCS/man/mpv.rst: add documentation for the numpad +/- key bindings 2024-12-01 18:55:50 +01:00
nanahi
8c6ad1dc81 etc/input.conf: add KP_PLUS/KP_SUBTRACT key bindings
Same as d06f3d39cb.
2024-12-01 18:55:50 +01:00
Guido Cella
c8d9f37b27 command: fix --osd-selected{,-outline}-color
Using 3 %x in a row can produce colors like 0ff0 which are interpreted
incorrectly, so ensure each colors has 2 digits.
2024-12-01 18:54:50 +01:00
llyyr
744cd70640 DOCS/options.rst: specify that gpu-sw only works with OpenGL/Vulkan 2024-12-01 12:22:15 +01:00
llyyr
1a03d6ab84 vulkan/context: propagate --gpu-sw on vulkan contexts 2024-12-01 12:22:15 +01:00
Kacper Michajłow
d673356990 common: ensure MP_HANDLE_OOM is used only on pointers
To make it clear it should be used for memory allocation and not generic
error checking.
2024-11-30 17:08:42 +02:00
Kacper Michajłow
7b114d7d54 ad_lavc: remove unnecesary variable 2024-11-30 17:08:42 +02:00
der richter
7e519397a1 options: note that --gamma-auto is only implemented on vo=gpu 2024-11-30 02:32:39 +01:00
der richter
dec0d02f9f vo_gpu: undeprecate --gamma-factor
deprecated since 0.35 in ac39661 and 2207236.
2024-11-30 02:32:39 +01:00
moi15moi
a283f66ede sd_ass: add application/x-font-otf to font_mimetypes 2024-11-28 17:35:22 +01:00
Kacper Michajłow
6ea2cd72ec vf_format: fix format=dolbyvision=no metadata stripping
If p->colormatrix is 0 if not set by user, so it would always override
_orig parameters with Dolby Vision ones and restore that erroneously.

Fixes: e2365bfece
2024-11-28 17:33:31 +01:00
Kacper Michajłow
4ff9f50b6b player/clipboard/clipboard: don't include global.h in header
This header should not be included except when really needed.

Fixes: e1d30c4c5a
2024-11-28 00:45:27 +01:00
nanahi
7899a28699 defaults.js: support custom arg in mp.add_key_binding() 2024-11-27 20:40:41 +01:00
nanahi
06670298b3 defaults.lua: support custom arg in mp.add_key_binding()
The information is available in the table.
2024-11-27 20:40:41 +01:00
nanahi
0874f81b31 command: add custom arg for script-binding
This allows passing arbitrary information in the script-binding
command. The content is available as a new message argument.
2024-11-27 20:40:41 +01:00
nanahi
aeb637b33b DOCS/man/input.rst: document that WHEEL_* are scalable
This documents the scalable keys (currently WHEEL_*) and notes
how the keys work with scalable commands. Mention touch pad
as a common source of scalable input source.
2024-11-27 20:40:41 +01:00
nanahi
0d6c979220 DOCS/man/input.rst: document the scalable commands 2024-11-27 20:40:41 +01:00
nanahi
62e434ac7f input/cmd: add comment for scalable and is_ignore 2024-11-27 20:40:41 +01:00
nanahi
5fd4bfb4a0 defaults.js: support scalable mp.add_key_binding() 2024-11-27 20:40:41 +01:00