Commit Graph
54640 Commits
Author SHA1 Message Date
Kacper Michajłow 825ba4167e hwdec_d3d11va: add support for RGB formats
This will be useful for mapping RGB output from d3d11vpp tone mapping.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2aba5a7167 ra_d3d11: allow mapping rgba10_a2 format
This is needed for ra_get_imgfmt_desc() which otherwise would not allow
rgba10_a2 format, because it doesn't have all components with the same
size. However it's nativelly supported by d3d11, so we add it to special
formats, same as opengl does.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 18330cb1ed video/img_format: add repack test for new formats 2026-02-19 19:18:56 +01:00
Kacper Michajłow 54976fe147 video/img_format: add IMGFMT definitions for x2bgr10 and rgba16f
Will be useful for mapping hardware frames. We could add more formats
here, but those should be enough to allow RGB processing.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 71bc92a080 video/img_format: move IMGFMT_X2RGB10 from custom range 2026-02-19 19:18:56 +01:00
Kacper Michajłow 7b015a9846 video/img_format: remove custom rgb30 definition
It's supported in ffmpeg since 4.4, no need to keep custom code for it.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2b4b345a3a video/img_format: rename IMGFMT_RGB30 to IMGFMT_X2RGB10
It's supported in ffmpeg, so let's have naming parity.
2026-02-19 19:18:56 +01:00
Kacper Michajłow af47c1d43b vo_drm: don't define custom IMGFMT values
We should never make such mappings that are not covered by
img_formats.h.
2026-02-19 14:20:56 +01:00
Kacper Michajłow e9a3bf2ad1 vo_drm: use always little endian formats
DRM formats are little endian, unless the format is ORed with
DRM_FORMAT_BIG_ENDIAN.
2026-02-19 14:20:56 +01:00
Kacper Michajłow 73ae34e2d0 vo_drm: fix xbgr2101010 format mapping
Fixes: 6b452788c4
2026-02-19 14:20:56 +01:00
Kacper Michajłow c2c081f49a vf_d3d11vpp: use half-rate for IVTC mode
The optimal way would be to use custom rate based on telecine cadence,
but it's not supported by any driver in practice. So instead, allow
driver to field match and output with duplicated frames, which can be
removed using decimate filter.

Note that in practice all GPU vendors uses single video processor for
all deinterlacing, so IVTC will be done even if mode is not explicitly
selected. At least the field matching part, because correct rate output
is not supported. The main difference is that when selecting more we
output at video frame rate, not field rate.
2026-02-18 18:13:18 +01:00
Kacper Michajłow f571fd73a1 vf_d3d11vpp: print supported custom rates 2026-02-18 18:13:18 +01:00
Kacper Michajłow 2141fa88b3 vf_d3d11vpp: fix deinterlacing
There were multiple issues in API usage, not setting correct
OutputIndex, lying about frame field parity to make it work without
OutputIndex. Not passing reference frames which forced BOB mode always.

Fix all issues and allow forcing BLEND/BOB mode by not passing frames.
Blend mode also sets half rate output. Half rate could be separate
option too, but there is not much gain from it except for debugging
really.

Fixes: #15197
2026-02-18 18:13:18 +01:00
Kacper Michajłow 47ed5785e4 video/filter/refqueue: add mp_refqueue_output_fields 2026-02-18 18:13:18 +01:00
Kacper Michajłow db2352f69a vf_d3d11vpp: update mode selection logging 2026-02-18 18:13:18 +01:00
Kacper Michajłow 626f1344c8 vf_d3d11vpp: rename ivctc to ivtc
This was a typo. Although this changes the user option name, this
filter, especially this option, is so niche that I fix it without a
deprecation period.
2026-02-18 18:13:18 +01:00
Guido Cella aa82213726 select.lua: don't set an empty prompt
Not needed since 44816ef8ff.
2026-02-15 16:36:28 +01:00
Guido Cella 102e693f49 select.lua: sort the track submenu
track-list doesn't necessarily return tracks sorted by type so we need
to sort them ourselves.
2026-02-14 01:07:27 +01:00
llyyr 1a160f9767 Revert "ci/tumbleweed: disable sanitizers for GCC build"
This reverts commit 5b0cfe8849.

Shouldn't be needed after previous commit
2026-02-14 00:43:52 +01:00
llyyr a7523a4afd demux_mf: satisfy gcc ubsan so it doesn't produce bogus warnings
Since we call bstr0 on the string anyway, might as well use it for
printing which implicitly includes a null check that gcc can see so it
doesn't produce the warning as seen in the next commit anymore
2026-02-14 00:43:52 +01:00
Dudemanguy 76a5eba991 player: don't mangle current playlist entry before initialization
Scripts and things using the client API can load up playlists in a
specific order and choose what file to start playing on by using the
loadfile or loadlist commands with the play argument. However if
starting from idle mode, it is possible to send these commands before
all scripts finish initializing. mpv's core then does a prepare_playlist
call on its own for startup which will nuke the current playlist entry
set by the API user and lead to an unexpected item being played. Fix
this by not unconditionally setting pl->current to NULL allow callers to
optionally always overwrite it by getting the first item in the playlist
(e.g. if it's called after startup anywhere else in the code). Other
options like --playlist-start or --shuffle are allowed to win if they
happen to be set.
2026-02-12 04:42:32 +00:00
Dudemanguy 3847a8157f wayland: handle all outputs disappearing without segfaulting
If you switch TTYs while mpv is playing, wlroots compositors will remove
all outputs from the registry. This segfaults when you switch back since
we try to access cleared memory. Rework this so wl->current_output is
given null when appropriate and properly guarded. You still need at
least one output to initially place the surface, but in general they can
all disappear during runtime and it should work. Change the log to
verbose because that becomes just noise in this case (switching TTYs).
The surface entrance event happens later and should get all the proper
parameters.
2026-02-10 00:46:55 +00:00
llyyr f0f9322c57 vo_dmabuf_wayland: only wait for image description if we have a buffer
Waiting for color management from the compositor doesn't make sense in
other cases and this breaks --force-window since the playloop doesn't
advance. Fixes #17391.
2026-02-10 00:35:28 +00:00
Dudemanguy d5bc61596d vo: clear request_redraw in render_frame only if video is playing
27a78276eb almost got it but it should be
an and condition not an or. When we unlock VO to draw the core, the OSD
can update after we flip the page and the player can also pause itself
in that time. That means that we will clear the redraw request but due
to the OSD update it actually needs to draw again. Because the player
paused itself in that time frame, this redraw gets lost and you have the
mismatch. The simplest way to avoid that case is to only clear the
redraw_request while mpv is playing. The paused case will always get
handled later in do_redraw so it does not get missed. The slight
downside is that it's technically possible to do a redundant redraw
(e.g. what if you pause before draw_frame), but this theoretical
inefficiency is deemed not really relevant or important enough to add
more confusing code to avoid. Fixes #17288.
2026-02-09 14:43:46 +00:00
Kacper Michajłow 4fd2600c65 d3d11: support --d3d11-output-format fully for gpu-next 2026-02-08 22:14:18 +01:00
Kacper Michajłow c9c039b7f1 d3d11: set pl_d3d11_swapchain_params.alpha_bits if alpha is needed 2026-02-08 22:14:18 +01:00
llyyr 67886c97dd vulkan: set pl_vulkan_swapchain_params.alpha_bits if alpha needed
We can try to calculate specific amount of bit required in the future,
and also populate color_bits field but for now this should suffice.

Ref: https://code.videolan.org/videolan/libplacebo/-/merge_requests/767
2026-02-08 18:52:56 +01:00
sfan5 60dd40d007 test/img_format: remove dead code 2026-02-08 11:51:26 +01:00
sfan5 e01165d3db test/repack: test draw_bmp at some uneven sizes
intended to discover bugs like f3c1dcf7a1
2026-02-08 11:51:26 +01:00
sfan5 272404533e test: add reference files for ffmpeg 8 2026-02-08 11:51:26 +01:00
Guido Cella 1f686769cd mp.input: deprecate log_error()
This was a mistake. It's too situational and it's not worth complicating
the API and every mp.input client with it. It made some sense before I
implemented input.select() because you could use input.get() to input a
choice and validate it, but in general for input.get() clients it's
better to show an error with input.set_log() instead of adding new lines
to the log everytime. This is what e.g.
https://framagit.org/Midgard/mpv-subber/-/blob/master/subber.lua does.

So this is only marginally useful for REPL scripts that keep adding
lines to the log, and the only such scripts are commands.lua and my
lua-repl.lua. commands.lua never used it and I already removed it from
lua-repl.lua. Cloning all scripts in the wiki reveals that **nobody** is
using log_error(), confirming that it is safe to deprecate.
2026-02-08 11:51:17 +01:00
sfan5 b6512e1f8d wayland_common: improve probing behavior and logging
Any errors when opening the display are now logged.
The WAYLAND_DISPLAY check now also logs and applies only when probing.
This means explicitly setting a wayland `--gpu-context` will always
try to open the display instead of "helpfully" refusing (in some cases).

see also: f6f1721101
2026-02-08 01:56:01 +01:00
Steve Williams 9ccd8899ff sub/draw_bmp: limit memset to available width in last slice
extends f3c1dcf7a1 for all lines not just
the last. This avoid unnecessary write every line and fixes a buffer
overflow for small enough images (for example 78x64).
2026-02-06 11:01:59 +01:00
Kacper Michajłow 97867450ba osdep/w32_register: fix EstimatedSize
Move PathCchRemoveFileSpec after actually getting the file size. It must
have been swapped at some point by accident.

Also use correct unit for the size.

Fixes: #17375
2026-02-05 23:23:38 +01:00
Steve Williams 339ac9b305 wayland: set image_description_processed when not using color mgmnt
otherwise wl->image_description_processed will always be false and
the window will not show.
Follows 468d34c9bd.
2026-02-05 16:07:15 +00:00
verygoodlee 70c893988a select.lua: quote and escape string arguments in menu item commands
try to define a `[foo \ "bar"]` profile in mpv.conf, the command
to apply it in context-menu is `apply-profile foo \ "bar"`,
which is obviously incorrect, the correct command should be
`apply-profile "foo \\ \"bar\""`.

for string arguments that may contain spaces or some special
characters, we need to quote and escape them in JSON-style,
fortunately, `utils.format_json` can do this very well.
2026-02-05 16:14:48 +01:00
Guido Cella ea82915ba7 menu.conf: change duplicate hints
Deduplicate:
Op&en and &Editions/Titles
&Quit and &Quit watch later
2026-02-03 21:05:38 +01:00
llyyr db22a4528f vo: reset wait_on_vo if render_frame is called without current_frame
Fixes a deadlock when switching vo before a frame is displayed (e.g.
with auto profiles) where we'd end up in a state where wait_on_vo is set
to true for the first frame and then draw_frame is never called again so
its value never changes even once dmabuf-wayland is ready to advance
frame

Fixes: 468d34c9bd ("vo: allow VOs to request waiting before advancing frames")
2026-02-02 01:04:16 +00:00
verygoodlee 40d2947fa3 DOCS/man/lua: fix the arg of callback function for "mp.register_event" 2026-01-31 16:56:13 +01:00
Guido Cella d6eeff690d select.lua: handle empty lines at the end of the file
Prevent a crash in this case due to lines[i + 1] being nil.
2026-01-31 14:26:04 +01:00
Guido Cella a0f593202a select.lua: handle carriage returns in menu.conf
Fixes https://github.com/mpv-player/mpv/pull/16816#issuecomment-3804029038
2026-01-31 14:26:04 +01:00
Guido Cella 2cef09820d context_menu.lua: apply disabled_color to separators
As per Samillion's suggestion, reduce the contrast between separators
and the background to match other context menus. Using the already
defined disabled_color works for this and seems to be what GTK and Qt
do at a glance.
2026-01-31 13:20:05 +01:00
Dudemanguy ee843f4db7 player/command: fix repeatable frame stepping with the seek argument
730062b510 fixed the problem with mouse
buttons but unfortunately we forgot to include repeated commands in the
condition. This effectively made any variant of "frame-step X seek"
unrepeatable even though it was supposed to be. So just allow those in
add_step_frame too.

Fixes #17348.
2026-01-31 01:20:14 +00:00
Guido Cella 01cb6433c0 select.lua: always observe --osd-playlist-entry
The playlist submenu does not update in this edge case:

- Have a playlist-count > 99 on the first vo-configured. This makes
  playlist() return before observing --osd-playlist-entry.
- Remove playlist entries until the count is < 100
- Change --osd-playlist-entry
- Show the playlist submenu before changing the playlist
2026-01-30 10:53:19 +01:00
verygoodlee c5c8e8a39a console.lua: allow scrolling up the log until only one line remains
Currently, if some log lines have very long text that actually
renders across multiple lines, even if you scroll to the top,
the topmost content will be pushed out of the screen by these
lines and will never be visible.

In STATS page 2/4/5/0, you can scroll down until there is one
line left on the screen, we can keep the scrolling behavior of
the log consistent with it.
2026-01-30 10:53:07 +01:00
Kacper Michajłow 54da0ba070 demux/packet_pool: unref packet early if we can do it without penalty 2026-01-28 18:40:19 +01:00
Kacper Michajłow a1ea4f3aec demux/packet_pool: always return default packet state from pop
This is not functional change, as pop() is only used in packet_create()
which already cleared the packet, but it's better to make it explcit.
2026-01-28 18:40:19 +01:00
Kacper Michajłow 3b17ab5d3b demux/packet: add demux_packet_unref helper 2026-01-28 18:40:19 +01:00
Guido Cella d79172ac3e select.lua: update the playlist submenu after playlist-move
Observing playlist-pos and playlist-count is not enough to update it
after playlist-move, but we can observe any playlist property with type
none to get notified of every MP_EVENT_CHANGE_PLAYLIST, even if the
property has not changed.

This is similar to the
mp.observe_property("vsync-jitter", "none", recorder) hack used by
stats.lua to replicate the deprecated tick event.

Fixes https://github.com/mpv-player/mpv/pull/16816#discussion_r2727498518
2026-01-28 15:21:38 +01:00
Guido Cella d1743b641b menu.conf: change duplicate hints
Deduplicate:
&Properties and Copy &path
C&enter and D&einterlace
&Speed and &Shuffle
2026-01-26 11:47:16 +01:00