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.
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
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
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.
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)
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"
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
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.
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.
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.
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.
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
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.
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
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").
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
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.
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.
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.
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.
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.
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.
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.
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.