Commit Graph

53383 Commits

Author SHA1 Message Date
Jisu Kim
e2014fb309 osc.lua: add option to enable fade-in effect
Introduced a new `fadein` option to control the fade-in effect for the OSC.
The default value is `no`, which disables fade-in. This option allows users
to enable a fade-in effect when the OSC appears. Updated documentation
accordingly.
2024-12-10 22:41:40 +01:00
Guido Cella
8d76ff79a3 console.lua: rename dimension variables
These are easier to read with _ between words. Also screenx/y could be
assumed to be display coordinates, so rename them to osd_w/h. They are
not named osd_width/osd_height to avoid Redefined local LSP warnings
with the ones in the upper scope.
2024-12-10 22:21:31 +01:00
nanahi
65328563e7 command: signal unavailable error when clipboard is unavailable
This allows clients to detect if the clipboard is unavailable,
or an error happened.
2024-12-10 14:20:08 +01:00
nanahi
e121c092b4 clipboard-vo: make logging verbose when clipboard is unavailable
It now only warns when the clipboard is implemented but get/set
failed. This is consistent with other properties like current-vo.
2024-12-10 14:20:08 +01:00
nanahi
e62503cb39 clipboard: add CLIPBOARD_UNAVAILABLE error code
This makes it possible to distinguish between unavailable
or unsupported, and error.
2024-12-10 14:20:08 +01:00
Guido Cella
7bae5b8d37 console.lua: clear completions before searching history 2024-12-10 14:18:51 +01:00
Guido Cella
7253b6c63d console.lua: remove code repetition to initialize matches 2024-12-10 14:18:51 +01:00
Kacper Michajłow
3df8b0b297 video/out/gpu/video: don't pass big structs by value when not needed 2024-12-10 14:14:09 +01:00
Kacper Michajłow
c00bd46684 m_option: put UPDATE_ flags at the beginning
Update flags are often updated, so make space for expand them. Reorder
all values to make it easier to add new ones, until there is no more
space.

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2024-12-10 13:52:39 +01:00
Guido Cella
5dbaa69138 console.lua: add margin_{x,y} script-opts
Allow configuring the margins from the left bottom indipendently of
--osd-margin-{x,y}.

Fixes #15478.
2024-12-10 13:47:43 +01:00
Kacper Michajłow
db70ae6fa2 hwdec_vaapi: don't jump over variable init in try_format_upload 2024-12-10 10:17:34 +01:00
Kacper Michajłow
63e6dfba6e demux_mkv: fix memory leak of codec params
Fixes: 84ee84abb8
2024-12-09 20:46:48 +02:00
Guido Cella
0bb1659cd6 configfiles: refactor mp_get_playback_resume_config_filename()
This avoids duplicating fname when it is a URL.
2024-12-09 19:23:03 +01:00
Guido Cella
a5fa862a44 configfiles: don't use the basename of urls
With --ignore-path-in-watch-later-config the basename of files is used
for watch later files, but since 1d640c9887 this was checking the wrong
variable to determine if the file is a URL and thus also taking the
basename of URLs, when URLs should use the full path regardless of this
option.
2024-12-09 19:23:03 +01:00
Guido Cella
94135b1245 console.lua: don't override --osd-bold in completions
Respect the OSD bold style in completions printed after the selected
one.

Fixes #15452.
2024-12-09 19:21:33 +01:00
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