Commit Graph
54237 Commits
Author SHA1 Message Date
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
sfan5 653e241ac3 DOCS/lua: fix mistyped function name 2025-08-22 08:38:02 +02:00
sfan5 521e162420 DOCS/input: clarify value of hwdec-current
This can never be false, or a boolean at all.
2025-08-22 08:38:02 +02:00
nanahi bde63fe092 wayland_common: handle wayland events in VOCTRL_CHECK_EVENTS
VOCTRL_CHECK_EVENTS is used to handle input and redraw events, so it is
necessary to check the input events from the windows system when this is
called. X11 already does this, and win32 does not need to do this since
the input events are processed in the UI thread, not VO thread.

However, this is not done on wayland. On wayland, input events are only
processed in vo_wayland_wait_frame and vo_wayland_wait_events.

If Vulkan gpu api is used, then vo_wayland_wait_frame is only called in
wayland_vk_swap_buffers, and only when using the internal vsync, and not
when fifo protocol is being used.

vo_wayland_wait_events is only called in wait_vo. However, unlike
VOCTRL_CHECK_EVENTS which is sent on every VO render loop, wait_vo is not
called when the VO has a frame to redraw immediately, which can happen
often in display-sync modes. In the worst case, this is never called.

All of the above result in situations where inputs and other wayland
events not being handled in time while not rendering, or rapid rendering
with wayland internal vsync disabled.

Fix this by checking wayland events in VOCTRL_CHECK_EVENTS, similar to X11,
to make sure these events are handled.
2025-08-20 13:34:54 +00:00
Philip Langdale 12a78257a8 vo/vulkan: sync recommended Vulkan 1.x features from ffmpeg
This second set of additional features are ones from extensions that were
incorporated into Vulkan eventually. As we do not require Vulkan to be newer
than 1.2, we must request the 1.3 and 1.4 features via their original
original extensions, while the others can use the core feature structs.

This change assumes that libplacebo can correctly merge features using their
old extensions or using the core feature structs.
2025-08-18 08:44:35 -07:00
Philip Langdale 91e0b6cbda vo/vulkan: sync recommended extensions and features from ffmpeg
Over time, the list of requested extensions and features has diverged from
ffmpeg (libhwcontext_vulkan), and while this isn't guaranteed to cause
problems, as it depends on driver behaviour, it definitely makes it hard to
compare validation errors between the two implementations.

This change requests the extensions/features which have not been incorporated
into any Vulkan version.
2025-08-18 08:44:35 -07:00
Kacper Michajłow 6b96aff174 vo_gpu_next: initialize min_luma correctly
This is also important in non-hint mode and hint SDR mode.

Fixes `--target-contrast=auto`.
2025-08-18 04:47:04 +02:00
Dudemanguy ce7ea3d8ea path-unix: support ~~desktop path expansion
xdg-user-dirs is basically the standard for defining user desktop
directories on linux/bsd. To account for locales and languages, we
basically have to parse the config file (~/.config/user-dirs.dirs)
directly. That or call xdg-user-dir. Either way, it's a little more
complicated than the others, but still doable enough.
2025-08-17 16:58:00 +00:00
Kacper Michajłow 07572dc83c vd_lavc: don't select software output format if hwdec failed
Let us fallback fully to software decoder. There is an issue in ffmpeg
where if we return software format here for hwdec threading context it
will be assumed to be usable, but not accelerated, which would be fine,
but later it causes assertion failure when copying avctx context
between decoding threads in ffmpeg.

Avoid this issue, but returing NONE format after we failed.
2025-08-15 20:24:19 +02:00
Kacper Michajłow dbda70a11c vd_lavc: add --hwdec-threads
No reason to not enable threads if lavc supports them, same as for
software decoding. Might help with pipelining of decoding and filtering.

Performance difference may vary, but in my testing everything is working
as expected and I didn't notice any regressions.

Set to 2 threads by default as conservative value that should resolve
stalling issue, while also not spawn too many cpu threads, which won't
help with hwdec anyway and only can cause too deep queue of hardware
surfaces.

Fixes: #16578
2025-08-15 20:24:19 +02:00
Kacper Michajłow fcb50a77bb vd_lavc: fix AVCodecContext use in get_format callback
When using more than one threads, the callback can be called from
different thread from sibling avctx, we cannot use our main one to query
codec/hw_frames paramters.

Use context provided in callback arg to fix that.
2025-08-15 20:24:19 +02:00
Kacper Michajłow 7653cc8f09 vo_gpu_next: respect ICC profile color space
When ICC profile is applied, use it also in hint to ensure correct
target colorspace configuration. ICC profile takes precedence over
anything else, to make sure libplacebo internally interpret it the same.

Fixes: #16646
2025-08-14 22:32:43 +02:00
Kacper Michajłow 227d958d29 vo_gpu_next: don't use unitialized min_luma in some cases
Also double check if 1e-7 doesn't underflow float.
2025-08-14 22:32:10 +02:00
verygoodlee 4c17803b91 options: delete the duplicated extension "wav" in --audio-exts
fixes: 44a3a3293f
2025-08-14 22:26:34 +02:00
Kacper Michajłow 3132ad62a3 vo_gpu_next: don't hint colorspace when ICC profile is used
We don't know which colorspace the profile were created from. We could
set hint to ICC target colorspace, but it would be ambiguous, because it
doesn't say which colorspace were configured in practice.

Additionally on Wayland with all the color management the client side
ICC correction is not supported, because we cannot set pass-through
mode.

Conceptually we should use VK_COLOR_SPACE_PASS_THROUGH_EXT to get
"direct" access to display response, but while this may work on macOS,
on Wayland it means "don't configure csp", instead of "configure to
pass-through", which means colorspace would have to be configured
externally, which is also not possible, see [1].

You can also see [2] for more discussion on the topic.

For now let's not hint any colospace and leave libplacebo in default
selection. Which restores previous status quo. This can be improved in
future, but for now this fixes use of ICC profiles in default mpv
config.

[1] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/27
[2] https://github.com/haasn/libplacebo/issues/324

Fixes: #16646
2025-08-13 03:52:10 +02:00
Attila Fidan 211c9cb7c9 stream_libarchive: seek source stream to 0 before probing
If p->mpa = NULL due to an error during a seek or fill_buffer, then when
archive_entry_seek(), if newpos != s->pos, reopen_archive() ->
mp_archive_new() -> mp_archive_probe(), which asserts stream_tell(src)
== 0. This won't be the case if the previous mpa left the source stream
seeked in the middle of the file.

For example, in samples in archives where avformat_find_stream_info
takes a long time, if playback is aborted while the demuxer is doing
that, reading from the source stream will stop working due to cancels
being triggered. When archive_entry_seek() and newpos != s->pos,
reopen_archive() -> mp_archive_new_raw() -> archive_read_open1() fails
and returns with mpa == NULL due to reads not working. Then when another
seek happens, reopen_archive() -> mp_archive_new() -> mp_archive_probe()
-> assertion failed.

One solution is to have reopen_archive return STREAM_ERROR if the stream
is cancelled, since nothing useful can happen in this case. But there
are other situations where p->mpa could become NULL (fatal errors), and
it is supposed to be possible to seek back to a working area of the
archive.

Fixes: https://github.com/mpv-player/mpv/issues/15174
2025-08-12 18:38:50 +02:00
Kacper Michajłow 01b7edcc71 stats.lua: round max-cll to integer
In source-dynamic mode this can be converted from PQ, round it to
integer, same as max-luma already is.
2025-08-09 20:42:17 +02:00
Kacper Michajłow 91b10ffe2c vo_gpu_next: when tone-mapping, set better maxCLL value 2025-08-09 20:42:17 +02:00
llyyr e011596bc3 vo_vdpau: recommend vaapi directly instead of vo in emulated case 2025-08-08 09:48:53 +02:00
llyyr dfc232a44b vo_{vaapi,vdpau}: recommend gpu-next over gpu
Missed in d21b1f159c
2025-08-08 09:48:53 +02:00
Dudemanguy 2b74582fcb Revert "various: remove unneeded option path expansion handling"
Fixes #16573.

This reverts commit 137d5374bd.
2025-08-08 01:07:00 +00:00
Dudemanguy 6a5eb8c229 Reapply "external_files: parse ~ in --{sub,audio}-paths"
This reverts commit 768ad8f035.
2025-08-08 01:07:00 +00:00
Dudemanguy ed7b1aca0b DOCS/interface-changes: add backticks to tls-options
It's what is normally done.
2025-08-08 01:07:00 +00:00
Dudemanguy 26373c5497 Reapply "options: parse tls-related options as path"
This reverts commit 5c4c067ee6.
2025-08-08 01:07:00 +00:00
Dudemanguy 29307c26ba Reapply "various: expand paths for all file/directory related options"
This reverts commit 43fda5442f.
2025-08-08 01:07:00 +00:00
Dudemanguy a664eede96 Revert "test: always build path_source and options/path.c for test_utils"
No longer needed.

This reverts commit afbd3abb20.
2025-08-08 01:07:00 +00:00
Dudemanguy e0d06ecedc Revert "m_option: automatically expand paths for M_OPT_FILE options"
It would be nice to expand all path arguments for free in the option
code, but life isn't so simple. Because of string list options, we have
to expand at parsing time. Because of libmpv, mpv_global has to be
passed around a million places. Even after doing all that, there's still
a drawback where anything defined in builtin.conf (used for setting
default profiles and such) will be unable to correctly resolve paths if
the user uses --config-dir. Nothing currently defined in builtin.conf
would be subject to that and it's not likely that anyone would add
anything that would be, but it's a limitation that can't be changed
because this has to be parsed before the user's command line and before
mpv_global is set. There's also another problem of pretty printing paths
which are now always full paths instead of relative ones. It's not so
nice if the user's home path is something very long. This could be dealt
with by saving an unexpanded path in some field in the opt somewhere and
then doing that for pretty printing but with all this extra
complication, it's questionable if there's really any net gain at the
end of the day. Calling mp_get_user_path on some opt->whatever is a lot
simpler and always works. So this commit goes back to the old model
along with the following reverts/reapplies.

This reverts commit 9b7374ea40.
2025-08-08 01:07:00 +00:00
sfan5 866da80979 vo_gpu_next: fix resetting --glsl-shader-opts
fixes: #16638
2025-08-07 18:35:42 +02:00
Kacper Michajłow c4bc4f6d5b stream_bluray: use bd_get_main_title() to get main title
It uses a more sophisticated heuristic for title selection. It not only
selects the longest title but also considers quality and chapters. Refer
to the libbluray source for details.

No documentation change, "longest" option will still look for the
longest, just may work better now.

Fixes selection of title on some discs.
2025-08-06 18:04:46 +02:00
Kacper Michajłow 9681bda7d5 meson: bump libbluray requirement to 0.5.0
Released 2013-12-21. Will be used for bd_get_main_title().
2025-08-06 18:04:46 +02:00
Kacper Michajłow bdca44773a stream: remove stream_info_bdnav
It was disabled in 3b3170aedb.
2025-08-06 18:04:46 +02:00
Kacper Michajłow b6d8336658 stream_dvdnav: fix --edition when dvd:// is not used directly
When directory is redirected to dvd demuxer, --edition was ignored.
2025-08-06 18:04:46 +02:00
Kacper Michajłow 218561fe69 stream_bluray: fix --edition when bd:// is not used directly
When directory is redirected to bd demuxer, --edition was ignored.
2025-08-06 18:04:46 +02:00
LordMZTE b7c92c77a4 vo_gpu_next: allow unsetting LUTs
This adds support for unsetting a LUT set by the target-lut or image-lut
property by setting the property to an empty string. Previously, this
would cause an attempt to read a file named ''.
2025-08-06 18:04:05 +02:00
Dudemanguy 5b2bcc55db test: add some tests for the sub_sdh_filter 2025-08-06 13:57:38 +00:00
Dudemanguy cc7f9e3ce8 test/libmpv: inline some test-specific helpers in libmpv_common
These functions could be useful for any libmpv test and in fact
check_string was already duplicated in a couple of places. Inline them
in libmpv_common.
2025-08-06 13:57:38 +00:00