Commit Graph
53972 Commits
Author SHA1 Message Date
Guido Cella 52a95d91bd positioning.lua: validate that an amount is passed
Instead of crashing, show the correct usage when running pan-x, pan-y or
cursor-centric with script-message, or with script-binding but no
argument.
2025-03-31 12:04:37 +02:00
Guido Cella f0c3d466f9 DOCS/man/osc: fix custom button example formatting
The examples for each button were rendered in the same line.
2025-03-31 12:02:03 +02:00
verygoodlee f837e951af select.lua: simplify the time formatting function
The C version of time formatting function has been exposed to lua,
so why not use it, `osc.lua` and `stats.lua` are already using it.
2025-03-31 11:57:06 +02:00
Tom Grimwood-Taylor a407e13f83 misc/language: add a forced flag to the track add commands 2025-03-31 11:47:52 +02:00
Tom Grimwood-Taylor f608780032 misc/language: parse forced tag from external subtitle tracks
Fixes: mpv-player#16060
2025-03-31 11:47:52 +02:00
Leo Izen 2e215cc6a5 demux/demux_playlist: mark fd:// as self-expanding
The playlist demuxer won't propagate the protocol forward to its entries
if its protocol is on a whitelist, for example data:// or memory:// etc.

This commit adds fd:// to that list because that should not be expected
to work.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-03-31 11:34:57 +02:00
Kacper Michajłow 5ba7ee5137 demux_mpv: add missing URL unescape 2025-03-28 22:40:09 +01:00
Kacper Michajłow 94e100e389 ci/win32: pin shaderc version to fix build errors
See: https://github.com/KhronosGroup/glslang/issues/3914
2025-03-28 19:40:44 +01:00
Kacper Michajłow 26b29fba02 demux_mkv: fix compilation after deprecated definitions removal
See: https://github.com/FFmpeg/FFmpeg/commit/822432769868da325ba03774df1084aa78b9a5a0
2025-03-28 19:40:44 +01:00
sfan5 08939665fe DOCS: clarify some minor points in the release policy 2025-03-28 16:19:48 +01:00
llyyr d20ded876d clipboard-wayland: prevent reading from hung up fd
This causes mpv to use up 100% of a core if there's an offer for a
mime_type that mpv doesn't accept with ext_data_control clipboard
backend.
2025-03-28 16:08:36 +01:00
Dudemanguy 9cca045511 wayland: lrint some width/height calculations 2025-03-28 13:53:08 +00:00
Dudemanguy 9826e96ecc wayland: use logical coordinates when setting the opaque region
Core wayland works in the surface local/logical coordinates so the width
and height values should really be divided by the scale factor.
2025-03-28 13:53:08 +00:00
Kacper Michajłow 38439dd531 threads: remove unused recursive mutex support
After removal of `MP_MUTEX_RECURSIVE` from vdpau.c there are no more
clients of recursive mutex. Remove all the code related to it. This
commit can be reverted if in the future it is needed again. For now
let's not keep dead code.
2025-03-26 19:16:21 +01:00
Lynne 9964104a6e vd_lavc: enable FFv1 hwaccel by default
FFmpeg recently got a hardware accelerated decoder for FFv1.
The decoder has been tested on all major vendors and operating systems.
Intel support is currently disabled as all of their drivers have issues
with buffer device addresses.
Since its a software-defined implementation, internal issues can be fixed
and the overall implementation optimized further.

With that, I think it should be safe to enable it by default.
2025-03-26 18:40:58 +01:00
Kacper Michajłow 74d3c2f0e7 mp_image: set repr.alpha and repr.bits when mapping AVFrame
Fixes invalid colors with gpu-next direct mapping of some formats.
2025-03-26 18:39:40 +01:00
Kacper Michajłow d9f27bd0f1 video/vdpau: change is_preempted bool to atomic
And eliminate recursive lock. This doesn't have to be guarded by mutex,
if for some reason preemption happens while we are handling preemption,
we remember the flag and do the dance gain. This is even nicer than
locking preemption callback.
2025-03-26 18:31:54 +01:00
한승민 513ccb9227 DOCS/interface-changes/kitty-passthrough: option addition notice 2025-03-26 18:25:49 +01:00
한승민 699a0bec42 vo_kitty: use priv as talloc context
- `priv` is used as `talloc_ctx`/`ta_parent` in `bstr_xappend_*` calls.
- `free_bufs` no longer frees `priv->cmd.start`.
- `bstr_*_passthrough` functions have been stripped off the `bstr_x`
  prefix.
2025-03-26 18:25:49 +01:00
한승민 ccad32e961 vo_kitty: remove DCS_GUARD_* macros
The `DCS_GUARD_*` macros have been removed in the favor of actual
functions
2025-03-26 18:25:49 +01:00
한승민 8edabd5644 vo_kitty: do not add trailing NULL byte in payload
In the past `strlen` was used in the write function, which omitted the
trailing NULL byte, however with the addition of `bstr` API the NULL
byte produced by `av_base64_encode` in the output is also written to
stdout, this causes terminals (namely Ghostty) to not display the frame.

There was also an additional edge case where if the entire output is
less than 4096 bytes the finishing escape sequence `\033_Gm=0;` was
never emitted. Adding a check for this after the for loop fixes this
behavior.
2025-03-26 18:25:49 +01:00
한승민 d9dc84c0fc vo_kitty: add auto-multiplexer-passthrough option
Terminal multiplexers like (screen, tmux, ...) do not support the kitty
image protocol (as of yet), to go around this DCS escape sequences are
used (`\ePtmux;...\e\` for tmux, `\eP...\e\` for screen). This option
allows passing thorugh the kitty image escape sequences.

`\033\\` suffixes from `KITTY_ESC_IMG_SHM` and `KITTY_ESC_DELETE_ALL`
have been removed. This makes it easier to wrap the escape sequences in
a DCS control sequence since there will be no `\033` in them to escape
(as multiplexers require escaping the escapes within the DCS data
string). `DCS_GUARD_WRITE` and `DCS_GUARD_APPEND` macros have been added
to wrap escape sequences in DCS control sequence based on the
availability of the `priv->dcs_prefix` property.
2025-03-26 18:25:49 +01:00
한승민 aad5329fd1 vo_kitty: reallocate cmd.start on reconfigure
`priv->cmd.start` is being freed in `reconfig` without being allocated
again this caused a segfault if `flip_page` was called after `reconfig`.
This segfault could be triggered by sending a SIGWINCH (resizing the
terminal).
2025-03-26 18:25:49 +01:00
Dudemanguy 0c3f1c0f6e build: make drm optional again for vo_dmabuf_wayland
We used to deal more directly with drm-specific things, but that has all
since been removed and is known to not be needed. We can relax the build
requirements some more since vo_dmabuf_wayland will simply error out if
no hwdec backend is available at init.
2025-03-26 15:31:08 +01:00
DudemanguyandKacper Michajłow a9dccf22a1 build: use a drm_fourcc header check for vaapi on gl
The underlying interop only needs the DRM fourcc defined in the header.

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2025-03-26 15:31:08 +01:00
Guido Cella e88864aef3 commands.lua: add remember_input script-opt
Allow clearing the input line on close. Fixes #16104.
2025-03-26 14:56:48 +01:00
Guido Cella ba80e447a6 console.lua: use a variadic function 2025-03-26 14:48:37 +01:00
Dudemanguy 1b231b4e57 wayland: accept version 2 of the cursor-shape protocol
The version 2 changes only add some enums which makes zero difference to
us so we can just allow the newer version.
2025-03-26 02:19:44 +00:00
Guido Cella 6ec0d06aa9 console.lua: use double quotes
Make it consistent with other scripts.
2025-03-26 02:53:01 +01:00
nanahi af1ac0f685 playloop: only notify MP_EVENT_INPUT_PROCESSED when needed
MP_EVENT_INPUT_PROCESSED is used to notify mouse and touch position
updates, but it is currently notified for all input commands even when
they have nothing to do with mouse position. This results in unnecessary
acquisition and comparision of mouse and touch positions for all commands.

Optimize this by checking whether the command is marked as requiring the
event notification, and only notify if that is true.
2025-03-26 01:33:21 +01:00
nanahi ca6e26399f input: mark mouse and touch position update in mp_cmd
This makes it possible to distinguish these dummy commands
for position update notification from other commands.
2025-03-26 01:33:21 +01:00
nanahi f676a9ff20 stats.lua: cache some properties
Some properties can take a long time to query, especially those which
require voctrl like current-window-scale and display-names.

Similar to d37521b5ef, make the script
observe these properties and cache the values to avoid querying them
on every refresh. This alleviates the issue when holding down "i" key
for a while and releasing it results in stats being stuck on display
for a long time because of the time required to query there properties.
2025-03-26 01:30:46 +01:00
nanahi e70d67f7ca DOCS/man/options: remove bogus messages about the client API
The messages referred to "no" prefixes like --no-audio not working with
the client API. The language was removed in
b1ee92ad4a.

Remove the messages which are bogus and incorrect now.
2025-03-26 01:29:52 +01:00
Kacper Michajłow f972cb6dc4 meson: disable stack protector for mpv.com
This is a bare runner for mpv.exe. There is no need for a stack
protector here and when it is forced to be added by -fno-stack-protector
it complains about missing symbols, because we don't link any standard
libs here.

Fixes:
undefined symbol: __stack_chk_fail
undefined symbol: __stack_chk_guard

We could define those, but mpv.com wrapper doesn't need it.
2025-03-26 01:28:50 +01:00
sfan5 97cb16d683 RELEASE_NOTES: remove accidental BOM
linting is good and all but does this check really need to fail on every single commit from now on?
2025-03-25 18:39:00 +01:00
sfan5 2da0b49038 Update MPV_VERSION 2025-03-25 18:36:18 +01:00
sfan5 e48ac7ce08 Release 0.40.0 v0.40.0 2025-03-25 18:33:27 +01:00
sfan5 425037a16a DOCS: refresh some parts of the release policy 2025-03-25 17:57:53 +01:00
nanahi 01e68e653c m_option: fix string list printing for empty lists
When converting list options to strings and the value is empty, an
empty string is returned. This is true for key value list and object
settings list options. However, for string list options, there is an
edge case: if the list exists but has no element (which can happen
when using change-list command), it behaves as if the property does
not exist and returns "(error)". This causes confusing messages when
toggling glsl-shaders at runtime and seeing "(error)" printed as the
value when all shaders are toggled off, for example.

8461143ed7 attempted to fix it, which
fixed the case for unset string list, but not for a list with no
element.

Fix this by making sure an empty string is returned in this case.
2025-03-25 17:14:01 +01:00
Guido Cella b31c3d80ab commands.lua: prevent infinite logging with debug log level
With -v -v there was an infinite loop of log messages, because every new
logged script message to console triggers a new script message, which
gets logged again.
2025-03-23 22:56:39 +01:00
Christoph Heinrich 958fee6895 ytdl_hook.lua: fix duplicated chapters
Sometimes when opening a YouTube video with chapters, the chapter-list
ended up having all the chapters twice, despite the json from yt-dlp only
containing them once. That must mean that sometimes add_single_video()
runs twice before the chapter_list table gets cleared in the
on_preloaded hook.

This can be avoided by replacing chapter_list with a new table before
adding entries to it.
2025-03-23 22:52:12 +01:00
Kacper Michajłow 8e4493b4a2 Revert "input.conf: bind MBTN_MID to align-to-cursor"
It can be too easy to change the video position without a single way to
undo the change. Also, this is mostly useful for images. Binding can be
brought back in a better way with an image profile or another method
that is more resistant to accidental clicks.

This reverts commit e98d3b62ec.
2025-03-23 22:49:00 +01:00
Kacper Michajłow 903c805a37 vo: don't burn cpu in paused state for untimed VOs
Fixes VO thread busy looping in paused state for untimed VOs.

One example is vo_lavc (encoding mode), used commonly to extract
thumbnail by scripts.

Example command that was affected:
mpv --ovc=rawvideo --of=image2 --ofopts=update=1 --o=test --pause
file.ext

We have to update request_redraw value to not redraw again. This has
been skipped by early exit before.

This also fixes VO_CAP_NORETAIN case.

Fixes: 8798cec7fa
2025-03-23 17:58:19 +01:00
llyyr b22a4da1df demux_lavf: disable extension_picky for hls demuxer globally
Added in https://github.com/FFmpeg/FFmpeg/commit/91d96dc8ddaebe0b6cb393f672085e6bfaf15a31

The user can still turn this on via demuxer-lavf-o=extension_picky=1 if
they want to.

This causes quite a few problems with many HLS sources where the codecs
are not known at probe time for whatever reason. Youtube for instance
transports aac audio inside ".ts" extension urls which are disallowed by
this option.

As an aside, the FFmpeg test is also buggy and leaks a nested
connection for any playlist item that fails the extension check. mpv
catches this and prints "Leaking 1 nested connections (FFmpeg bug)" for
every HLS stream that has at least one stream that fails the extension
check.
2025-03-23 14:48:06 +01:00
llyyr 678419c5f6 video/out/kitty: set display_par when drawing osd 2025-03-22 17:39:16 +01:00
Lynne a55ae5d6cd vulkan/context: enable VK_KHR_video_maintenance2 if supported
VK_KHR_video_maintenance2 was recently merged in FFmpeg. It significantly
speeds up some problematic HEVC samples, as it avoids needing to recreate
sequence parameters on each frame.
It also generally speeds up everything as it avoids needing to ask the
driver to allocate memory for parameters it sends on every frame anyway.
2025-03-21 18:29:05 -07:00
Guido Cella 6171e4800c select.lua: display chapters when before the first chapter
When the first chapter is not at the start of the file but after the
current time position, the chapter property is -1, which prevented
displaying any chapter.

Fixes #16073.
2025-03-19 12:28:44 +01:00
llyyr 8aa7d783d2 wayland: round values instead of implicitly casting float to int
This matches the behavior of mpv's own drm backend when setting hdr
metadata, as well as Mesa's vulkan wsi's behavior when communicating
VK_EXT_hdr_metadata values to the compositor
2025-03-18 17:38:58 +00:00
Kacper Michajłow 76241dd4a6 ci/build-win32.ps1: exit on errors from external commands early
This requires PowerShell 7.4+ to work, but it's fine for our CI.
2025-03-18 12:38:58 +01:00
Dudemanguy 6c42182522 Revert "console.lua: disable cursor autohide while selector is open"
In retrospect, this isn't so great because not neccesarily everyone
would want the mouse to show with the menu and said menu can be
navigated with the keyboard anyway.

This reverts commit a8f5beb5a3.
2025-03-15 05:19:43 +00:00