Commit Graph

6859 Commits

Author SHA1 Message Date
Chainik 44a9b03f24 vf_vapoursynth: improve backward compatibility
The previous commit to dynamically load VapourSynth R74 would fail to work
for VapourSynth R73 and before on Linux due to load mode RTLD_LOCAL. To
make it work on all VapourSynth version, switch to use RTLD_GLOBAL mode.
2026-05-31 18:16:18 +02:00
Chainik 3650c67b6d Revert "vf_vapoursynth: improve backward compatibility"
This reverts commit 8aabba933b.
2026-05-31 18:16:18 +02:00
llyyr cce65c722c wayland: map ICtCp coefficients to BT.2100 HLG as well
H.273 defines a single ICtCp matrix coefficients for both BT.2100 PQ and
HLG.
2026-05-27 15:21:19 +02:00
Philip Langdale d05814ceef hwdec_vulkan: fix partial failure edge cases in error paths
This is another file where the slopbot identified a problem, but I was
surprised to see it fix it in a poor way and also miss an adjacement
problem.

`mapper_map` calls `mapper_unmap` with the intention of using it to clean
up partial failure after some planes are wrapped and released while others
are not. But the current code would actually segfault in that situation.

There are two fixes required:

* Ensure `p->vkf` is set by `mapper_map` early so that its available to
  `mapper_unmap` in the error path
* Don't call `vkfc->unlock_frame` in the `mapper_map` error path, as
  this will be called by `mapper_unmap`

Fixes #17977
2026-05-26 18:22:04 -07:00
Philip Langdale 89b95243ef hwdec_cuda: fix partial failure edge cases in error paths
The slopbot spam did find valid issues in the error paths in this code, and as
part of verifying them, I have additional fixes.

* ensure that the return value -1 from `cuda_init()` if `ext_init()` fails
* zero alloc the `ext_vk` and `ext_gl` structs so that we have a known initial
  state
* explicitly initialise the `sem_handle.fd` to -1 to ensure we don't
  accidentally close stdin in the error path. But also don't do this on
  windows as an invalid Handle is 0.
* Don't do a double `cuCtxPopCurrent()` in the `ext_gl` init failure path

Fixes #17976, #17988, #17989
2026-05-26 18:22:04 -07:00
Mikael Magnusson 5f5839aadb video/out/x11_common: set the source indication to 1 in vo_x11_minimize
This was the only call that didn't do this.
2026-05-20 10:55:59 +02:00
Mikael Magnusson c0ef68904d video/out/x11_common: add --focus-on support in X11
Note that when the video params don't change, the check in
player/video.c does not call vo_reconfig2 and the _NET_ACTIVE_WINDOW
message is not sent. As far as I can tell, the same limitation is true
for the macOS implementation, but I can't test that.
2026-05-20 10:55:59 +02:00
Lynne 4c72a03546 video/decode: enable APV hwdec by default
Today, FFmpeg got an APV decoder written in Vulkan compute shaders.
2026-05-20 10:55:48 +02:00
Lynne 98c3ae4add vulkan/context: don't activate descriptor buffers after ffmpeg 8.1 2026-05-19 17:35:08 +02:00
Lynne 873a1e8a24 vulkan/context: activate runtime array indexing and non-uniform accesses
We use them everywhere in Vulkan in FFmpeg now.
2026-05-19 17:35:08 +02:00
Clinton Phillips 35ae76daad docs/comments: fix more doubled-word typos
Follow-up to #17926, addressing the four additional instances flagged
by @garoto:

- DOCS/man/options.rst: "output size size is limited" -> "output size is limited"
- DOCS/man/input.rst: "Called after after a file" -> "Called after a file"
- video/out/gpu/video.c: "target target that needs to be written" -> "target that needs to be written"
- video/out/x11_common.c: "enable DPMS only we we disabled it before" -> "enable DPMS only if we disabled it before"
  (this one wasn't a pure duplicate — the first "we" was a typo for "if"; the comment now matches the conditional on the line above)
2026-05-18 16:47:14 +02:00
Clinton Phillips 779378c248 docs/comments: fix doubled-word typos
Pure typo fixes in user-facing manpages, interface changelog, and
source comments. No behavior change.

- DOCS/man/encode.rst: "copying of the the comment" -> "copying of the comment"
- DOCS/man/options.rst: "visible takes the the menu bar" -> "takes the menu bar"
- DOCS/interface-changes.rst: "rename the the lua-settings/" -> "rename the lua-settings/"
- video/out/present_sync.c: "requires that that caller" -> "requires that the caller"
- player/lua.c: "try to get by by filtering" -> "try to get by filtering"
2026-05-16 05:26:02 +02:00
llyyr f4d059b1d9 vd_lavc: disallow hwdec for grouped streams
44a2c33939 tried to do this in a cute way by unsetting the hwdev to
be used for hwdec, but this doesn't prevent -copy variants from being
probed. Instead explicitly disallow it for grouped streams
2026-05-13 22:24:07 +02:00
llyyr 914114a2cf wayland: fix typo 2026-05-13 15:28:29 +00:00
llyyr 02b4f8ca69 wayland: remove stray spaces before function call parenthesis 2026-05-13 15:28:29 +00:00
llyyr 90f63675ce wayland: return bool values for bool type create_input function
Also invert the return value to better match the rest of the file, and
adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr bef4dc37db wayland: convert create_xdg_surface to bool
create_xdg_surface returns success/failure, so use bool instead of int
for its return type. Also invert the return values to better match the
style of the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr ff2d112132 wayland: convert create_viewports to bool
create_viewports returns success/failure, so use bool instead of int for
its return type. Also invert the return values to better match the style
of the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr e92538b1db wayland: convert spawn_cursor to bool
spawn_cursor returns success/failure, so use bool instead of int for its
return type. Also invert the return values to better match the style of
the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr d28bc02393 wayland: convert check_for_resize to bool
Only returns if a resize edge was found
2026-05-13 15:28:29 +00:00
llyyr ae811ddbbb wayland: log current preferred scale, not older stale one 2026-05-13 15:28:29 +00:00
llyyr 6c34c07b36 wayland: null-check before munmap call
munmap(NULL, 0) returns a failure, also this follows project style
2026-05-13 15:28:29 +00:00
llyyr db4506be45 wayland: fix resize edge boundary checks
The `>` checks exclude a pixel, which is asymmetric with the `<` checks.
Use `>=` for the right and bottom resize edge checks, to not skip a
pixel.
2026-05-13 15:28:29 +00:00
llyyr 3a5e05720e wayland: fix condition for tablet tool cursor shape device destroy 2026-05-13 15:28:29 +00:00
llyyr 0be060ed76 wayland: fix mapping for PAL/NTSC primaries
525 lines is NTSC, 625 lines is PAL. Previously we had them reversed.
2026-05-13 15:28:29 +00:00
Kacper Michajłow cdf77d9274 vo_gpu_next: always cache frames in paused state and never interpolate 2026-05-13 11:22:09 +02:00
Kacper Michajłow 0c4ad9adf6 vo_gpu_next: respect interpolation-preserve option for cache flush
Flush cache only if interpolation-preserve is off, or in paused state to
get immediate update.

Fixes unnecessary cache flushes when parameters of external hooks are
updated rapidly.
2026-05-13 11:22:09 +02:00
llyyr 4414547d62 wayland: use lrint for keepaspect window sizing
Avoid biasing sizes upwards
2026-05-09 14:50:17 +02:00
llyyr 1a1288184a wayland: force redraw on every configure when in toplevel resize state
This fixes stalled/slow resize when there's only an image being
displayed or no output at all. When there's a video playing, the video
implicitly causes a redraw but we need to redraw ourselves when there's
no video.

Fixes: https://github.com/mpv-player/mpv/issues/16744
2026-05-09 14:50:17 +02:00
Kacper Michajłow cfd818bcae ra_gl: fix memory leak 2026-05-05 20:17:24 +02:00
Ivan Shapovalov ce71cd8aeb mp_image: refine check for supported Dolby Vision metadata
Improve the Dolby Vision metadata check to accept RPUs that indicate EL
usage (profiles 4 and 7) if the original bitstream and metadata are
MEL-only, instead of hardcoding a check for disable_residual_flag.

This needs libplacebo commit a4783f89 ("util/libav: do not bail on
MEL-only RPUs w/EL"), or libplacebo API version 359.
2026-05-03 11:49:47 +02:00
Kacper Michajłow 7c25b3e47c vo_gpu_next: fix upload synchronization
And make them actually async when copied from host ptr. The issue was
when we used DR buf upload, which is always async, it was not
synchronized in anyway.

Fixes: #13811
2026-05-03 08:47:34 +02:00
nanahi 675fb1229b input/dnd: move --drag-and-drop handling to dnd client
This unifies --drag-and-drop handling to a single place. All platforms
currently only support normal drop (mapped to "replace") and shift click
drop (mapped to "append").
2026-05-01 13:42:57 +02:00
nanahi 5e0932e785 input: rename mp_event_drop_files to mp_input_drop_files
Move it to input.c. Will be used in next commit.
2026-05-01 13:42:57 +02:00
Kacper Michajłow 44ceaa6498 vo_gpu_next: only flush cache on render options update
No need to reset input queue too.
2026-05-01 10:41:41 +02:00
Kacper Michajłow 8d04be2b85 mp_image: force stride to be multiple of bpp
Vulkan require all sizes in texels, so we have to make our image
multiple of them.

Fixes: #17743
2026-05-01 10:41:28 +02:00
llyyr a44478d79f vulkan/context: avoid printing incorrect error on vulkan-device fail
M_OPT_INVALID says "option parameter could not be parsed" which is
incorrect for some failures this parser might encounter. Instead print
something that might be useful for the user to debug.

Vulkan instance might fail to create if there's no vulkan drivers that
mpv can see, or devices might fail to enumerate for whatever reason
2026-05-01 06:09:00 +02:00
Dudemanguy b1d23bba5e vo_gpu_next: don't spam render queue underrun logs on frame->still
If we are redrawing on a still image (e.g. ass events), then the pl
queue will hit the PL_QUEUE_MORE case which is fine but there's no need
to spam the log here. The information may be useful for when an actual
video is being played, but when a frame is still (e.g. paused or only a
single image) it's just noise.

Fixes #17840.
2026-04-30 15:01:34 +00:00
Dudemanguy a42b1b9103 wayland: only update toplevel state values if we have a valid state
We have this annoying situation here during the initial window
configuration where sometimes we have to update certain values and other
times they need to be ignored. 45324ce682
made sure to parse the toplevel state before we checked the initial
compositor values which is correct. But it's not enough because mpv can
have its own initial state (e.g. --fullscreen) and by moving it here it
would get overwritten in the toplevel state check and thus ignored. So
to have our cake and eat it too, we need to only update the internal
state values if we know mpv is in a valid state in the first place. So
either we've set the initial geometry already or the compositor has
given us some specific initial state to work with. Fixes #17819.
2026-04-27 14:39:05 +00:00
Crend King 8aabba933b vf_vapoursynth: improve backward compatibility
The previous commit to dynamically load VapourSynth R74 would fail to work
for VapourSynth R73 and before on Linux due to load mode RTLD_LOCAL. To
make it work on all VapourSynth version, switch to use RTLD_GLOBAL mode.

Add library handle closing in drv_vss_uninit for completeness.
2026-04-25 07:14:56 +02:00
Andrew Rabert 45324ce682 wayland: parse toplevel states before geometry_configured check
Fix toplevel state being lost before geometry_configured is
configured. Previously, for a KWin rule that set fullscreen (apply
initially or forced) when a --geometry was also specified, mpv would
render at --geometry size even though the compositor was treating it as
fullscreen. This resulted in geometry-sized content anchored to the
top-right without a titlebar. This mismatch of what mpv thinks and what
actually is can also be seen similarly with a KWin rule that sets a
maximize state.

With this change, mpv starts in fullscreen _proper_ (ie --fullscreen).
Exiting fullscreen then results in a window size as specified by the
--geometry.

For the other states this handles, I'm honestly not sure as I wasn't
able to force them. It _should_ be fine based on what I see here and
_logically_ is correct as mpv's state should always match what the
compositor informs it to be.
2026-04-25 04:47:32 +00:00
Julian Orth 4c9262664c wayland: implement session management
If the compositor supports session management, the mpv window is always
added to a session. The user can manage multiple sessions by using
`--wayland-session=<human-readable-name>`. Human-readable names are
mapped to session ids via files under `~/.local/state/mpv/sessions`. The
file name is computed as a hash of XDG_CURRENT_DESKTOP and the
human-readable name.

If multiple mpv instances are started with the same session name, the
latter mpv instance takes over the session.

Upon session restoration, the mpv window is restored by the compositor
according to its state from the previous session. What that entails is
compositor policy.
2026-04-24 15:36:44 +00:00
Crend King 75b2ccfeb1 vf_vapoursynth: update for VapourSynth R74
VapourSynth R74 changed two things relevant to mpv build process:

1) VSScript no longer has static library to link to, and only support runtime loading.
This is reflected on the new VSScript example in VapourSynth SDK.
2) The VSScript library name is changed from libvapoursynth-script to libvsscript for Linux
and MacOS.

The new VSScript initialization code is modified from their SDK example to utilize
mpv's mechanisms. Build dependency is also updated accordingly.
2026-04-23 01:38:48 +02:00
Kacper Michajłow 174bcec30e w32_common: support initial --fs and --window-maximized
Don't set maximized window state if we are entering fullscreen too, this
makes restoring later consistent.
2026-04-22 01:56:59 +02:00
Kacper Michajłow 9d526fc138 w32_common: keep client size on window state changes
Not all resizes should reset client size size.

Fixes: #17695
2026-04-22 01:56:59 +02:00
Kacper Michajłow 6ab49ac5d7 w32_common: clear window_minimized flag on minimize->maximize
It doesn't send RESTORE in this case, so the state got confused.

Fixes: #17678
2026-04-21 05:51:58 +02:00
Kacper Michajłow e7d3fe8668 vf_d3d11vpp: fix print index value 2026-04-21 05:08:49 +02:00
Kacper Michajłow 4d0666670a vo_gpu_next: don't dither scRGB
scRGB is basically intermediary format, but we don't really know what
would be the real target. And since we send floating-point buffer, we
can just expect the downstream will handle dithering and quantization at
some point.
2026-04-20 21:52:52 +02:00
NRK 7d1a598bdd vo_gpu: support parameters in RPN expressions 2026-04-20 21:52:06 +02:00
Kacper Michajłow 7eb1ef2fe0 video/out/filter_kernels: mark kernel-compatible windows as resizable
Mark every filter window whose libplacebo counterpart is resizable as
resizable in mpv too.

This allows --tscale-radius to be used. Prior to this, vo=gpu
silently ignored the radius override while vo=gpu-next honored it,
producing different output for the same options.
2026-04-20 21:51:34 +02:00