Commit Graph
54612 Commits
Author SHA1 Message Date
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
Guido Cella eadba4469f menu.conf: add open-chat to the context menu 2026-01-26 11:11:38 +01:00
Guido Cella d7f0efb67b context_menu.lua: make ESC close only submenus when they are open
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3798278219
2026-01-26 10:50:50 +01:00
Guido Cella 70d3dc58e8 context_menu.lua: activate key hints with caps lock
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3797615909
2026-01-26 10:32:05 +01:00
Guido Cella 7bfa2cfd3d input.conf: add context menu bindings
Rebind MENU to show the context menu. Shift+F10 is also bound because it
is a standard context menu binding.

MENU is not added to restore-old-bindings.conf because it is uncommon.
2026-01-25 20:56:42 +01:00
Guido Cella f4b37b6455 select.lua: populate the context menu
Make select.lua parse menu.conf on the first vo-configured and fill
menu-data with the properties referenced in menu.conf change. This is
disabled in the libmpv profile.

This is done from select.lua to reuse functions to format the data and
retrieve key bindings.

There is also a script-binding that opens the correct context menu
depending on --load-context-menu.

While the context menu is scrollable, for the playlist it is better to
start from around the current entry rather than from the beginning, and
since menu-data has no way to specify where to start, when there are
more than 25 items playlist items this adds … entries that open the
scrollable console menu when clicked.

input-bindings is parsed to show the shortcuts bound to commands. Since
it is not observable, it just uses the bindings from the first time the
context menu is opened.

Multimedia and numpad keys are also not shown to reduce clutter.

The old Context Menu section of the docs is merged in the more detailed
context_menu.rst to not repeat the same information.
2026-01-25 20:56:42 +01:00
Guido Cella 8f2d69e1cc select.lua: skip key bindings of forced input sections
Avoid showing forced key bindings by modal scripts that temporarily
overwrite keybindings, like console and stats. These have section
input_forced_$scriptName. Unfortunately this skips all keybindings added
with mp.add_forced_key_binding even if you may want to show them.

Also skip the OSC sections "input" and "window-controls"; these sections
are not called input_forced_osc because the OSC uses
mp.enable_key_bindings() directly instead of mp.add_key_binding().

This mainly benefits the shortcuts in the context menu that the next
commit will add, but is also useful select/select-binding.
2026-01-25 20:56:42 +01:00
Guido Cella df7ac1d931 command: add the default-menu property
This property contains the builtin etc/menu.conf, and will be used by
select.lua. It is undocumented because it is for internal usage.
2026-01-25 20:56:42 +01:00
Guido Cella 19adc2d509 menu.conf: add this file
Add a default context menu definition in etc/menu.conf. It will be used
to populate the context menu.

The format is meant to be easily readable with just tabs as separators
and submenus denoted by indentation. It avoids complicating the builtin
input.conf like similar scripts do.

By not defining the shortcut keys in the builtin input.conf, menu
entries won't be associated to wrong shortcuts when the user's
input.conf changes key bindings without redefining the menu. Note that
external scripts don't have this issue.

I used 3+ spaces as separators at first but then realized that since we
have Windows users tabs will look better in editors with proportional
fonts like notepad, though it still won't be perfectly aligned depending
on the font. But I am still not sure what is better.

On a curious note, etc/menu.conf already existed in the past as mplayer
used to have a menu. git log -p etc/menu.conf will show commits from
2002 to 2011.
2026-01-25 20:56:42 +01:00
Guido Cella 7e38052138 input.conf: format some commands more consistently
The formatting of input.conf commands is totally inconsistent. At least
for the commands that will be used in the context menu, make it
consistent. The next commit will define the context menu commands, and
the keys bound to these commands will be shown in the menu only when
they match exactly, so this avoids copy pasting commands with
inconsistent formatting just to make them match.
2026-01-25 20:56:42 +01:00
Kacper Michajłow 6136c01f95 win32/menu: add mnemonic v for mpv sub-menu
`m` is taken by `Move`, use `v` as it's closer to alt+space than `p`.
2026-01-25 15:39:20 +01:00
Guido Cella e99a9168c1 context_menu.lua: implement key hints
When a character in an item's title is preceded by &, underline it and
activate the item when pressing the character.

Cycling between multiple items with the same hint is not supported.

&& escapes & so it works like the Windows context menu.

Hints after &&&, or greater odd numbers of &, are not supported since
Lua patterns don't support {n,m} quantifiers.
2026-01-25 05:21:49 +01:00
Kacper Michajłow dc5145c01d win32/menu: resolve system menu identity crisis
Don't reset system menu state, when menu data is empty, just disable the
items as needed. Fixes erratic behavior of system menu.

Fixes: 861908c70f
Fixes: #17290
2026-01-24 15:55:07 +01:00
Kacper Michajłow 3c09473327 Revert "ci/win32: manually install cmake to fix cpu detection issue"
No longer needed, upstream images has been fixed already.

This reverts commit e612f419f3.
2026-01-24 15:29:17 +01:00
Kacper Michajłow b5abb065a2 wayland_common: remove pl_color_space_infer
Common layer should alter target params anymore, it's on specific VO to
set correct params. Also this should be noop anyway, after
dmabuf_wayland fix in previous commits.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 43824e793b mp_image: call pl_color_space_infer in guess_csp
This will do a little bit more than only setting max_luma. Also will
fallback to bt.709/bt.1886, but that's fine. We would do it anyway
later.

If params goes through guess_csp, they shouldn't have "unknown" fields
anymore.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 9dd598def8 vo_dmabuf_wayland: ensure target params consistency 2026-01-24 14:08:08 +01:00
Filip Hejsek ed83c7c51e select.lua: add dvb_subtitle to the list of image subtitle codecs 2026-01-24 14:07:37 +01:00
Kacper Michajłow 9c6a3c06ec vo_kitty: add missing sequence end on unint
Fixes: #16299
2026-01-24 09:09:44 +01:00
Filip Hejsek 5d6f31f0a8 DOCS/man/options: fix typos and grammar errors 2026-01-24 08:02:28 +01:00
Steve Williams 16d9e12f37 wayland: add identity-rgb format mappings in color-representation 2026-01-24 08:00:07 +01:00
Filip Hejsek 7298ce13b0 test/samples: use mpeg2 codec for video samples
In CI, ffmpeg chooses vp9 by default, which cannot be muxed into mpegts.
2026-01-24 07:54:46 +01:00
Filip Hejsek c2882c3d81 player/loadfile: never autoselect tracks with wrong PID
Currently, we prefer selecting a track that matches the video program
ID, but can fall back on a track with a different program ID when there
is no such track or when no such track matches subs-fallback criteria.

Change this to instead select no track when only tracks with wrong PID
are available. Program ID will now act as a filter, not as a preference,
and only files with either matching or unset PID will be considered for
autoselect.

Also, ignore the program ID of external tracks, as it doesn't make much
sense to compare PIDs from different files.
2026-01-24 07:54:46 +01:00
Filip Hejsek 3e12e6fcff test/libmpv_test_track_selection: add a program ID matching test 2026-01-24 07:54:46 +01:00
Filip Hejsek bdbe40765a test/libmpv_test_track_selection: add a more complex locale test
The purpose of this test is mostly to verify that matching the OS
language is not wrongly prioritized over other things (like the forced
flag, matching the audio language, etc).
2026-01-24 07:54:46 +01:00
Filip Hejsek 79e87fa62d test/libmpv_test_track_selection: add a locale test with forced tracks
This is a copy of the existing locale test, but with forced flag added
to all tracks. The forced flag should not affect language selection in
this case.
2026-01-24 07:54:46 +01:00
Filip Hejsek 8aca078f09 test/libmpv_test_track_selection: add additional multilang test case
The new test case exercises --subs-fallback-forced=always and verifies
that default+forced is preferred over forced.
2026-01-24 07:54:46 +01:00
Filip Hejsek 6bae2c0f53 player/loadfile: simplify how external tracks are excluded
When autoload-files=no, external files are never selected. Simplify the
logic by excluding them up front instead of removing them afterwards.

This doesn't change the outcome of track selection, apart from edge
cases that are already broken because compare_track is not transitive.
2026-01-24 07:54:46 +01:00
Filip Hejsek a6cb319611 player/loadfile: simplify track selection logic
This fixes the problem that a subtitle track that normally wouldn't be
selected if it were the only track available could end up being selected
after a different candidate track was selected first.
2026-01-24 07:54:46 +01:00