Commit Graph
54272 Commits
Author SHA1 Message Date
Kacper Michajłow 8f6a4e50a2 Revert "vo: set swapchain-depth to 1 in display sync modes"
Allows to not wait for flip. Instead of forcing depth for display-sync
modes we will reduce default value instead.

This reverts commit d7495e4ea6.
Fixes: #16823
2025-09-27 22:15:13 +02:00
Guido Cella cabee53ebd context_menu.lua: make gap a percentage of the font_size
Avoids having to update the gap for most users who just want to change
the font size.
2025-09-27 19:26:54 +02:00
Guido Cella eac9ab275d console.lua: add gap script-opt 2025-09-27 19:26:54 +02:00
Guido Cella d8123d81bd console.lua: increase the gap between menu items
Make it less cluterred.
2025-09-27 19:26:54 +02:00
nanahi c1406fa5ec command: fix null dereference for invalid command in input-commands
mp_input_parse_cmd can return NULL. --input-commands=x segfaults with
null dereference. Fix this by adding null check.

Fixes: 533a684381
2025-09-27 18:32:47 +02:00
Dudemanguy 74b47cfcb4 test/libmpv_test_sdh_filter: start test paused and at 1 second
There is some race condition where MPV_EVENT_PROPERTY_CHANGE sometimes
gives us sub-text with an empty string which is unwanted and causes the
test to fail. Avoid this by starting the file at 1 second and paused
which hopefully avoids this. Do some additional checking on the actual
MPV_EVENT_PROPERTY_CHANGE as well to make sure we don't try to read
something we shouldn't.
2025-09-25 16:49:40 +00:00
llyyr be98b35c89 player/misc: show percentage progress for --stream-dump
Also use format modifiers instead of casting and fix type for `pos`
2025-09-23 18:45:15 +02:00
Kacper Michajłow ee0f701347 vo: remove "slack" frames from swapchain
Those are controlled by the `--swapchain-depth` option and is already
set to 3 by default. There is no need to add hardcoded hidden frame of
"slack". Users can adjust depth by changing the config.
2025-09-23 01:25:06 +02:00
Kacper Michajłow d7495e4ea6 vo: set swapchain-depth to 1 in display sync modes
All the math and interpolation assumes immediate presentation of the
frame. VO is driven by VSYNC and it is expected that current frame that
we render will be displayed on current present call, without delay.
2025-09-23 01:25:06 +02:00
Guido Cella f147b133f0 select.lua: add online documentation menu entry 2025-09-20 18:10:23 +02:00
Guido Cella 7c1a4acdb2 select.lua: add edit-config-file and edit-input-conf
Add script bindings to edit mpv.conf and input.conf, and add them to the
menu. These are useful as shortcuts, but the main motivation is that new
users often ask why they can't find mpv.conf and input.conf, so this
creates them if they don't exist.
2025-09-20 18:10:23 +02:00
ikas 0bbcc91e1b video/out/d3d11: add changing size support for composition mode 2025-09-19 02:26:08 +02:00
der richter 764da9919c ci/mac: add test runner for oldest macOS target
only meant for testing the oldest macOS target we support, currently
10.15, to catch possible usages of features that are not supported and
not properly guarded.

since dependencies are not build for that taget it will lead to a
partially broken build.
2025-09-16 02:47:33 +02:00
der richter a9cccbcd15 ci/mac: remove unnecessary cc and ccx variables 2025-09-16 02:47:33 +02:00
der richter 56ca37014b ci/mac: pin homebrew for macOS 13 runner to last working version
since macOS 13 is now unsupported and homebrew also dropped support for
it too, the macOS 13 bottle downloads were removed. leading to either
a broken or very long dependency installation (build from source).

to fix, pin the last known working homebrew version for macOS 13 where
the bottle download links weren't removed yet. for this to work we need
to disable (auto) update of homebrew.
2025-09-16 02:38:25 +02:00
ikas 6996c065c8 video/out/d3d11: return unknown color space when use composition 2025-09-16 02:38:01 +02:00
Guido Cella 8406834075 context_menu.lua: add this script
This implements a ASS context menu to be used on platforms other than
Windows.

The select script message will allow selecting an item with a single
click when releasing a mouse button, like in native context menus. This
is mainly useful to cycle pause with one click.
2025-09-15 04:12:57 +02:00
der richter af4e4fed44 meson: disable swift when cocoa not available or disabled
it doesn't make sense to build the swift parts without cocoa because
the swift bridge would be missing and it's impossible to interact
with the swift parts from obj-c, swift depends on cocoa/appkit/etc, and
the cocoa main function/main loop is missing making anything
cocoa/appkit/GUI crash on use.

like this it is possible to build mpv on macOS without cocoa, it will
fallback to the unix main function and mpv can run in 'headless' mode,
eg you can use it from CLI, it won't spawn any App icon/menu/etc, and
you can use everything that isn't related to cocoa/appkit/GUI like audio
playback. anything other will make mpv segfault, for example sdl2 and
its vo, since it tries to spawn a window.
2025-09-15 03:59:55 +02:00
der richter b4151d4449 meson: properly add path-mac.c to path_source and don't overwrite it
path-mac.c was not properly set as path_source for macOS. it didn't lead
to any errors because it was added to the normal source files. though
in the case of tests and for certain setups the mac path symbols were
not found.

to fix that properly add path-mac.c to path_source (additional to
path_darwin.c), remove it from the normal source files and don't
overwrite it later with the posix or darwin path.

this was overlooked in 9db8182 and #11374
2025-09-15 03:59:32 +02:00
der richter 065af28bc2 mac/dialog: fix build for macOS older than 11
UniformTypeIdentifiers is only available since macOS 11.
added in 6b0e4f7 and #15859.

guard the allowedContentTypes UTType property of the NSOpenPanel and
add a dummy struct UTType and dummy allowedContentTypes property on
macOS versions that don't have those available.
2025-09-15 03:59:32 +02:00
der richter a4d818b4f9 mac/compat: fix building with swift version lower than 5.7
currently we use the withLock function with NSCondition and NSLock,
which are not available on swift versions lower than 5.7. we only added
compatibility fallbacks for NSCondition though. introduced in 1364c80
and #14334.

instead of only adding the fallback to a specific class add it to the
whole protocol all the locking classes use, similar to the actual
implementation.
2025-09-15 03:59:32 +02:00
der richter 00415f1457 osdep/mac/meson: fallback to swift build for old swift versions
with commit 8d20b72 and PR #15442 we switched to the recommended swiftc
compiler for building our swift code. this lead to some
incompatibilities with swift versions prior to 5.8, where a new linker
was introduced.

work around that problem by using the old swift frontend build for older
swift versions. this can be removed when we remove the support for those
old versions.

Fixes #15591
2025-09-15 03:59:32 +02:00
der richter 5e4a406194 command: fix type mismatch 2025-09-15 03:59:32 +02:00
der richter 300b53de62 ci/mac: use oldest available xcode toolchain for macOS 13 runner
using the oldest xcode toolchain will test some code paths that weren't
previously tested, eg older SDK and swift versions.
2025-09-15 03:59:32 +02:00
cryeprecision 4a5a9a58a7 sub: remove upper limits of margin-x and margin-y 2025-09-15 03:58:50 +02:00
arch1t3cht eba7a11a2e player/command: do seamless angle change when bluray-angle is changed 2025-09-15 03:52:35 +02:00
arch1t3cht 31bd176357 stream_bluray: add bluray-angle option
1-index angles to be consistent with DVD angles in mpv and with the
1-indexing in other applications like libbluray's example programs.

The three existing calls to bd_get_title_info all only access the
duration, the playlist, and the number of angles, which do not depend on
the passed angle, so they can keep being called with angle 0 for
simplicity.

Documentation taken from before
35e8b6c1e6.

Fixes #5012.
2025-09-15 03:52:35 +02:00
arch1t3cht e6e7083ce6 options: remove leftover bluray_device field
This was moved to stream_bluray_opts in
8a7704ea89.
2025-09-15 03:52:35 +02:00
arch1t3cht 7b791733ce stream_bluray: show number of angles in title list 2025-09-15 03:52:35 +02:00
Kacper Michajłow 0d03e0565f osdep/win32-console-wrapper: remove stray include 2025-09-15 03:47:35 +02:00
Kacper Michajłow 7ee677c773 meson: add mpv-register and mpv-unregister helpers on Windows
They call `--register` / ``--unregister` for users who don't want to open
console and do it manually, this is one-click solution.
2025-09-15 03:47:35 +02:00
Kacper Michajłow 4f08802ff1 osdep/w32_register: add register/unregister options for Windows
On Linux, we have `mpv.desktop`, and on macOS, we have `osxbundle`, both
of which handle file associations and protocol registration in the
system environment.

On Windows, this information is stored in the registry, so this commit
adds support for it.

It registers the application, supported file types, and supported
protocols, and adds an uninstall entry so users can remove all
registrations via the control panel. Note that this does not remove the
binary itself.

The implementation is fully portable. There are no external installers,
as mpv handles everything automatically. This should improve usability
when moving binaries and so on.

- `mpv --register` registers mpv (see verbose output for a list of actions).
- `mpv --unregister` reverts all changes made during installation.
- `mpv --register-rpath <string>` allows specifying a string to be
  prepended to `PATH` before running mpv. This is useful when using
external dependencies that shouldn't be added globally to `PATH`.
2025-09-15 03:47:35 +02:00
Attila Fidan b9b3106d2f playloop: update window title in handle_force_window
When restarting or changing the VO while on the idle screen and using
force-window, this ensures that the new VO immediately receives a window
title.
2025-09-14 01:27:27 +02:00
nanahi 34b6439dc6 input/keycodes: fix combo key handling for - key
The current handling tries to handle the edge case where the current key
in a combo key is -, but when the current key is not - and the next key
is -, it misdetects - as separator and fails to parse correctly.

Fix this by restricting the handling to situations where the current key
is -.

Fixes: ce2367725e
2025-09-14 01:25:38 +02:00
Jan Ekström d837c43656 {demux_mkv,TOOLS/matroska}: map, expose hearing/visual impaired flags
Were brought up recently in the user channel, and seemed like an
easy enough win. Unfortunately `sh_stream` currently lacks other
fields, so the rest of the flags will be added as the player's
functionality gets extended further.

Ref: https://datatracker.ietf.org/doc/rfc9559/
2025-09-11 19:25:12 +03:00
nanahi 77dee9be2f DOCS/man/options: add usage note for --wid=0 for win32 2025-09-07 18:19:44 +02:00
nanahi 7a5ecf1c06 video/out/w32_common: support --wid=0
Similar to X11, this makes mpv attach to the desktop wallpaper window
(make the system create one if it does not yet exist) as parent,
which makes mpv display as desktop wallpaper behind desktop icons.

Lika an actual wallpaper, mpv will not receive any keyboard or mouse
input in this mode. It can still be controlled through terminal and IPC.
2025-09-07 18:19:44 +02:00
der richter b290781675 mac/title: fix mouse position when snapped to position from title bar
when the window is snapped to a position by dragging the title bar the
corresponding left mouse up event is prevented by the system snap event,
which leads to the window moving state not being reset and no mouse
position changes being reported. which makes UI elements unresponsive.

explicitly subscribe to left mouse up events for the whole app instead
of the mouse events from the title bar and reset the moving state.

Fixes #16732
2025-09-07 13:53:55 +02:00
Guido Cella b9ceaf243d console.lua: don't autoselect the wrong completion
The first completion is automatically inserted when Tab was not pressed,
but this is unwanted when you already typed one of the completions which
is not the first one, move back the cursor and press Enter.

e.g. if the line is "set vid", you place the cursor before "v" and press
Enter, it runs "set ab-loop-avid".

Fix this by aborting when the text in front of the cursor matches one of
the completions.
2025-09-02 21:43:20 +02:00
NotMithical 6269f4ffce ytdl_hook.lua: add support for VP9 profile 2 2025-09-02 21:42:14 +02:00
Guido Cella efb70d7f27 TOOLS/lua/autocrop.lua: don't error if hwdec-current is nil
hwdec-current can be either "no" or nil.

Fixes #16739.
2025-08-29 19:08:29 +02:00
Andarwinux 42fd091e47 osdep/win32/meson: use files() instead current_source_dir()
In reproducible builds, meson.current_source_dir() also leaks absolute paths, so it's better to use files() instead

ref: https://mesonbuild.com/Reference-manual_builtin_meson.html#mesoncurrent_source_dir

> You do not need to use this function!
> When passing files from the current source directory to a function since that is the default. Also, you can use the files() function to refer to files in the current or any other source directory instead of constructing paths manually with meson.current_source_dir().
2025-08-29 19:07:46 +02:00
der richter 0f910ec51c mac/common: render first frame on init if possible
since commit 5010c24 the initial window always shows a black frame
instead of the actual first rendered frame of the video, since the
visibility of the window for the initial render is always false. in the
worst case the first shown frame wasn't the intended first rendered
frame.

to prevent this, initial always allow rendering till the window is shown
or minimised. afterwards it will respect the occlusion state as before.

in the case of slow render pipeline initialisation and no frame being
ready to be rendered, it will still show a black frame.
2025-08-28 15:23:33 +02:00
der richter 78458a55ef mac/common: add support for force-render option 2025-08-28 15:23:33 +02:00
low-batt 9f153e2a20 mac/vulkan: fix frame not displayed when paused
add event handler for when window's occlusion state changes and now
indicates some or all of the window is visible.

handling of the event is needed due to the addition of a visibility
check for rendering that was added in commit 5010c24.

Fixes #16693
2025-08-24 12:58:26 +02:00
Kacper Michajłow 5faec4e6af ci/win32: disable libjxl tests
The need additional dependencies, that we don't need to build.
2025-08-24 01:42:00 +02:00
Kacper Michajłow 0e966ba071 stats.lua: show also min_luma if max_luma is nominal SDR
Useful to see set black point.
2025-08-24 01:21:35 +02:00
Shengyu Qu 90e3e104d9 wayland: add usage of set_chroma_location for wp-color-representation-v1
Previous implementation of wp-color-representation-v1 omitted usage of
set_chroma_location, so add it.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
2025-08-23 14:59:40 +00:00
sfan5 80d2a6a7ed ytdl_hook.lua: don't crash if playlist entries don't have an usable URL
see #16717
2025-08-23 15:02:46 +02:00
sfan5 194ce88ac3 player/command: fix missing property update for some hwdec changes
fixes #16710
2025-08-22 08:38:02 +02:00