Commit Graph
100 Commits
Author SHA1 Message Date
Kacper Michajłow f4db102a2e osdep/language-win: remove use of GetSystemPreferredUILanguages
The system preferred language is the language used during Windows
install. It doesn't have much purpose except that it is the backend
language for core Windows internals. All user facing dialogs and text
should follow the user preferred language, as this is what the user
selected and uses on daily basis.

It makes no sense to include system language in track selection.
2026-01-21 04:39:54 +01:00
Kacper Michajłow 5f6d5b3b7e ci/msys2: add build with -ftrivial-auto-var-init
Just to catch uninitialized variables early. Build all three                                                                                          unint/zero/pattern to compare the results between them and we don't                                                                                   accidentally depend on implicit initialization in tests.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 5fbd1caee2 ci/msys2: build also clang64 without ASAN
To cross compare results on basic build.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 1db89a546a Revert "ci/build-msys2.sh: disable pdf-build for clangarm64"
This reverts commit 25aa402f1d.
2026-01-18 12:59:16 +01:00
Kacper Michajłow a339fe58b5 osdep/language-win: fix use of GetUserPreferredUILanguages()
Commit baf2fd2f28 fixed this for 2nd call
to GetSystemPreferredUILanguages(), but apparently regressed the 1st
call, duh.

To retrieve the size both buffer has to be NULL and size 0.

Memory has a lot of zeros, because it has been working quite
consistently on CI.
2026-01-18 11:09:00 +01:00
Kacper Michajłow 9483d6e12f ci: cancel pr jobs after new push
github.head_ref is only defined for pull_request event, so only those
will be grouped, the rest will fallback to unique run_id, so we neither
cancel them or serialize.
2026-01-10 02:48:15 +01:00
Kacper Michajłow 3d980d8ecc w32_common: release all input when entering context menu 2026-01-09 20:16:23 +01:00
Kacper Michajłow 2b50cecf86 w32_common: defer context menu update to WM_INITMENU
This avoids issues when menu-data property is updated while context menu
is open.
2026-01-09 20:15:48 +01:00
Kacper Michajłow e75a174743 ci/win32: add subrandr
Wrap subrandr build process into meson custom target.

Meson's custom target allow only file output (without path component),
so additionall copy step is added to get the library. Dummy stamp file
is used to connect custom target to dependency, the file is actually not
created, so target will be called each time, but it's fine, because
cargo will resolve it's own dependencies this way and build if needed.

This is glued only for static lib, this is what we need for our CI
script.
2026-01-06 13:58:11 +01:00
Kacper Michajłow 273f1db49e player/loadfile: indent file metadata if it is multiline
And sanitize a bit.
2026-01-06 13:57:21 +01:00
Kacper Michajłow 6c160f1aa8 common/msg: allow only SGR sequence in terminal output
Sanitize the remaining control codes to mitigate malicious files or
scripts that could manipulate the terminal in unintended ways, such as
clearing the screen or changing the terminal title. While the
surface-level impact may seem minimal, control codes can be a vector for
exploiting vulnerabilities in the terminal emulator itself. This can
occur without user interaction, since file tags are displayed by default
in mpv.

Reported by: zefr0x
2026-01-06 13:57:21 +01:00
Kacper Michajłow 72efbfd009 version.h.in: bump copyright year 2026-01-01 13:26:59 +01:00
Kacper Michajłow f57c5ca422 ci/win32: upload pdb separately
The job id is now in the artifact filename, so we can identify the
matching pdb file.
2025-12-31 02:04:15 +01:00
Kacper Michajłow afa090317b ci: make artifact names more descriptive
Add git hash, job id and avoid double zipping.
2025-12-31 02:04:15 +01:00
Kacper Michajłow c0d989c839 sub/sd_sbr: check runtime version 2025-12-24 19:01:40 +01:00
Kacper Michajłow 5c80b876db ci/msys2: enable subrandr on clang64
Implib issue has been fixed upstream.

See: https://github.com/afishhh/subrandr/commit/d26a1536bd15fb2c3dbf7866b855fe674a7363bb
2025-12-24 13:38:38 +01:00
Kacper Michajłow 6dff941c71 ci/{win32,mingw64,msys2}: add amf-headers 2025-12-23 07:06:34 +01:00
Kacper Michajłow cb1b6a54f2 video/filter/vf_amf: add AMD Frame Rate Conversion filter
D3D11 only for now. Documentation says that only D3D11 and D3D12 is
supported, but it looks like Vulkan is possible too. But I realized this
after implementing this version. Vulan may be added later.

Fixes: #16613
2025-12-23 07:06:34 +01:00
Kacper Michajłow e72807e7a0 mp_image_pool: set D3D11 BindFlags for all hw frame pools
It's always needed, not only in d3d11vpp.
2025-12-23 07:06:34 +01:00
Kacper Michajłow 670a266475 ci/build-linux-old: remove custom libplacebo build
Alpine 3.21 has libplacebo 6.338.2, we can use that.
2025-12-22 17:30:05 +00:00
Kacper Michajłow 604b43184f ci/linux-ffmpeg-6-1: add wayland-protocols
Bump Alpine to 3.21. It still on ffmpeg 6.1, but has newer Wayland
components that we want to test.
2025-12-22 17:30:05 +00:00
Kacper Michajłow b95846a28c meson: check wayland-scanner version
At least 1.23 is needed for 1.38 protocols. Also check other Wayland
deps to be 1.23, they are likely bundled at the same version as scanner
anyway.
2025-12-22 17:30:05 +00:00
Kacper Michajłow f011d73d5f wayland_common: suppress unused function warning on older protocols 2025-12-22 17:30:05 +00:00
Kacper Michajłow 5820906024 vo: limit manual redraws to estimated display fps 2025-12-22 11:14:58 +01:00
Kacper Michajłow c0433f064e vf_format: deprecate --vf=format=sig-peak 2025-12-22 10:19:38 +01:00
Kacper Michajłow efc44d05ff vo: trigger manual redraws at most at slightly over display fps
This is workaround for some windowing platforms that break when they get
too many present requests.

Fixes: #17082
2025-12-21 11:30:31 +01:00
Kacper Michajłow a310a65d35 vo: put vo states into union
They won't be used together. Could be refactored to put them into priv,
but for now, let's avoid doing bigger refactor.
2025-12-19 18:08:20 +01:00
Kacper Michajłow 93b68d7fe2 meson: remove png icons from win32 resource depend
They are not used, everything is already packed in mpv-icon.ico.
2025-12-19 18:08:20 +01:00
Kacper Michajłow c35e10c2da vo: remove unused configs from context 2025-12-19 18:08:20 +01:00
Kacper Michajłow 6739fd490b filters/f_decoder_wrapper: reinit decoder on audio-spdif opt change
Fixes: #17072
2025-12-18 13:07:13 +01:00
Kacper Michajłow 122abdfec3 video/out/aspect: don't overflow intermediate values in scaling calc
This fixes calculation of scaling bounds with extreme video zoom levels.

Fixes: https://github.com/mpv-player/mpv/discussions/17123
2025-12-15 01:46:40 +01:00
Kacper Michajłow 5d89f15e97 video/out/gpu/hwdec: load native D3D RA hwdec drivers first
There is no reason to load EGL/VAAPI first as it would fail in default gpu
context/api anyway, on Windows.
2025-12-14 13:42:22 +01:00
Kacper Michajłow 95c7599c41 ci/win32: downgrade meson to 1.9.2
1.10.0 fails to build cmake projects.

See: https://github.com/mesonbuild/meson/issues/15360
2025-12-08 22:23:08 +01:00
Kacper Michajłow 72dbcf119a ci: update some github actions 2025-11-30 17:50:10 +01:00
Kacper Michajłow 23f9381b80 mp_image: add ycgco-{re,ro} support
Fixes: #17077
2025-11-28 18:28:06 +01:00
Kacper Michajłow 9a85ae3ee0 m_option: be more resilent to new enum additions
Unfortunately we don't have control over libplacebo and cannot
synchronize such changes, so just return `<unknown>` to be forward
compatible with any possible changed.

Note that this should be updated ASAP to support new values.
2025-11-28 18:28:06 +01:00
Kacper Michajłow 52525dceb8 demux: clear packet pool when upper memory limit is lowered
This clears packets from the pool, that would never be reused under new
settings. Note that depending on demuxer state this clears only unused
packets, in some cases demuxer may still hold more packets than the new
limit. Fox example demuxer doesn't forcefully clear forward cache when
reducing the size.

Also keep packet pool, even if current file is not cached, this is
useful for all sorts of things and may be useful for next file.

This act only on user options values, regardless of internal demuxer
caching state, which can vary depending on track type or source.
2025-11-20 20:35:00 +01:00
Kacper Michajłow 701201b13c ci/win32: bump ffmpeg to 8.0 2025-11-15 17:08:47 +01:00
Kacper Michajłow 0f5fafdaad osdep/compiler: fix typo in MP_ASSERT_UNREACHABLE 2025-11-15 01:25:37 +01:00
Kacper Michajłow 83cedd1074 meson: define WINICONV_CONST to strip const from win-iconv 2025-11-15 01:25:37 +01:00
Kacper Michajłow 4489ef54d9 ci/win32: fix aom CRT type to be consistent with the rest of the build 2025-11-15 01:25:37 +01:00
Kacper Michajłow a21e47c45d ao_pipewire: fix mapping of wide channels 2025-11-14 21:41:15 +01:00
Kacper Michajłow 867e808f6c ci/openbsd: update to 7.8
Update to cross-platform-actions 0.30.0.
2025-11-14 21:41:07 +01:00
Kacper Michajłow bbafb74880 vo_gpu_next: limit min_luma to 1000:1 contrast ratio in SDR mode 2025-11-07 02:42:42 +01:00
Kacper Michajłow 9b1d47ece1 mp_image: map hwdec format parameters correctly 2025-11-07 02:15:32 +01:00
Kacper Michajłow 5b0cfe8849 ci/tumbleweed: disable sanitizers for GCC build
It produces some bogus warnings when UBSAN is enabled:
../demux/demux_mf.c:103:22: error: ‘%s’ directive argument is null [-Werror=format-overflow=]

Which is clearly not possible at this point.
2025-11-04 21:50:06 +01:00
Kacper Michajłow 07622820d8 .lsan_suppressions: remove no longer needed suppression 2025-11-04 21:50:06 +01:00
Kacper Michajłow c3ba7bc0b1 ci: remove -Wno-error=deprecated
No longer needed and will let us spot deprecations sooner.
2025-11-04 21:50:06 +01:00
Kacper Michajłow 04055e5806 video/out/gpu/video: change treat-srgb-as-power22 default to auto
We want to have symmetry on the input and output. Also outputting sRGB
encoded image to gamma 2.2 display is clipping blacks. 2.2 displays are
more common and are reference sRGB display, which is what we should
target.
2025-11-04 20:51:50 +01:00
Kacper Michajłow 25aa402f1d ci/build-msys2.sh: disable pdf-build for clangarm64
See: https://github.com/msys2/MINGW-packages/issues/26007
2025-11-03 14:18:18 +01:00
Kacper Michajłow d3ec15bca8 stats.lua: remove prefix from display luminance metadata
People are getting confused about "HDR10" part.
2025-10-31 12:53:43 +01:00
Kacper Michajłow 0a84c0a204 vo_gpu_next: add workaround for broken linear output in libplacebo
See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/759
2025-10-29 15:36:15 +01:00
Kacper Michajłow 9b4341643f video/out/gpu/video: add --sdr-adjust-gamma 2025-10-29 15:36:15 +01:00
Kacper Michajłow 3e628c8d64 vo_gpu_next: linearize sRGB as a pure 2.2 power function
sRGB reference display is defined a 2.2 gamma device. To preserve the
look of the sRGB as mastered on such device, linearize it as such.

Note that sRGB encoding is piecewise with linear segment, which creates
mismatch to pure power 2.2 function, but this is intended to be viewed
on such display.

See:
IEC 61966-2-1-1999
https://community.acescentral.com/t/srgb-piece-wise-eotf-vs-pure-gamma/4024
https://github.com/KhronosGroup/DataFormat/issues/19
https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/12
https://github.com/dylanraga/win11hdr-srgb-to-gamma2.2-icm
2025-10-29 15:36:15 +01:00
Kacper Michajłow 532bac0b68 wayland_common: always prefer the PQ transfer for HDR output
Fixes: #16972
2025-10-28 10:38:55 +01:00
Kacper Michajłow 99d6d4c1c2 sub/osd_libass: change add_osd_ass_event argument to bstr
This allows to remove one dummy tmp allocation.
2025-10-19 18:35:40 +02:00
Kacper Michajłow 233e89698e video/out/gpu/video: make the target-contrast limit higher
OLEDs report min luminance of 0.0002 nits, while we couldn't set this
with options due to limit. Set limit, so that we cannot exceed the hdr
black value used in libplacebo in worst case scenario of target peak 10
nits.
2025-10-15 22:00:19 +02:00
Kacper Michajłow d204051d93 vo_gpu_next: use reported display contrast value also in SDR mode
It is useful in SDR mode to use correct target-contrast too.
2025-10-15 22:00:19 +02:00
Kacper Michajłow 10c9b3381b options: add mxf to video file extensions list 2025-10-15 22:00:08 +02:00
Kacper Michajłow fdbe06a6bc player/lua: fix UB in integerness check 2025-10-15 21:59:55 +02:00
Kacper Michajłow 339ad7e49e player/javascript: fix mp.set_property_number for integer properties
Fixes: #16911
2025-10-15 21:59:55 +02:00
Kacper Michajłow 2412feaf49 mp_image: use correct scaling for nominal peak
Fixes copy-paste error

Fixes: add2bf50cd
2025-10-10 06:24:17 +02:00
Kacper Michajłow 0fb40b654d stats.lua: split lines to make them shorter
Fixes: 92aeb63479
2025-10-10 06:14:42 +02:00
Kacper Michajłow 43b230b089 stats.lua: skip codec params if they are not available
Fixes: 2fd88ffbae
2025-10-10 06:14:42 +02:00
Kacper Michajłow add2bf50cd mp_image: use pl_color_space_nominal_luma_ex() to set nominal csp peak 2025-10-10 06:14:42 +02:00
Kacper Michajłow 9252ff4ce1 player/playloop: set consistent video parameters in idle mode
Prefer RGBA if available to avoid configuring color conversion that
wouldn't be used anyway. And set sRGB primaries, just for consistency.
2025-10-10 06:14:42 +02:00
Kacper Michajłow b5c538a9c7 vo_gpu_next: add --hdr-reference-white 2025-10-10 06:12:35 +02:00
Kacper Michajłow e70bb8802f ci/lint-commit-msg.py: modernize type hint 2025-10-07 22:11:02 +02:00
Kacper Michajłow 3ae5521367 mp_image: keep chroma location consistent for non-subsampled formats
Could also be set to unknown, but let's keep it center, so any fallbacks
in other places wouldn't trigger. In practice it shouldn't be used for
non-subsampled formats.
2025-10-07 18:50:53 +02:00
Kacper Michajłow 7dd035e937 vf_format: add some basic HDR10 metadata
Can be extended if needed.
2025-10-07 07:56:18 +02:00
Kacper Michajłow 96ce2d199d vf_format: add --vf=format=transfer alias 2025-10-07 07:56:18 +02:00
Kacper Michajłow 3c1abdb7bb DOCS/man/vf: add missing st428 in vf_format 2025-10-07 07:56:18 +02:00
Kacper Michajłow 3d39d992d0 av_common: check if position is not negative 2025-10-07 07:55:26 +02:00
Kacper Michajłow a0c4d7b1ca demux/cue: fix crash when there are no tracks 2025-10-07 07:55:26 +02:00
Kacper Michajłow 33f38423b3 vo_gpu_next: add --border-background=blur and --background-blur-radius 2025-10-06 16:27:50 +02:00
Kacper Michajłow df4bd5d1c8 DOCS/man/options: mention --target-gamut in colorspace hint mode
The description was not complete saying only about --target-prim.
2025-10-05 21:35:00 +02:00
Kacper Michajłow 20bf508b9d vo_gpu_next: don't force PQ output for SDR sources if target is unknown
We currently force PQ output when target_csp() is not available, to
preserve compatibility with backends that do not support it and to
enable HDR on them. However, for SDR transfers we can safely skip this
and simply use the source mode instead.

Ultimately, this "force PQ" mode needs to be removed, but target_csp()
is still not implemented for all relevant backends.
2025-10-05 21:35:00 +02:00
Kacper Michajłow 24647365a3 meson: don't define _UCRT_NOISY_NAN
The issue has been fixed in Windows SDK, if you are using affected SDK
version, update or downgrade to the working one.

See: https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
2025-10-05 21:34:29 +02:00
Kacper Michajłow 6c047794dd osdep/compiler: use __MINGW_{PRINTF,SCANF}_FORMAT for attribute format
This ensures that we test format string for the actual impl that is
being used. Depending if UCRT is used and if __USE_MINGW_ANSI_STDIO is
defined the implementation capabilities may differ.

Note that we don't explicitly define __USE_MINGW_ANSI_STDIO anymore,
this is defined implicitly in mingw headers, if needed. We don't support
ancient mingw versions that does not define it correctly for c11.
2025-10-05 21:34:29 +02:00
Kacper Michajłow 883db51ad0 osdep/compiler: refactor MP_ASSERT_UNREACHABLE 2025-10-05 21:34:29 +02:00
Kacper Michajłow 4338880560 various: add MP prefix for {PRINTF,SCANF}_ATTRIBUTE 2025-10-05 21:34:29 +02:00
Kacper Michajłow 17a3ac4cf2 mp_image: add support for AVAlphaMode 2025-10-04 03:26:57 +02:00
Kacper Michajłow 05656cdae7 mp_image: assume content has sRGB transfer when is full range
BT.1886 is mostly limited to TV production which is almost exclusively
limited range. sRGB for full range is better guess, if no better
information is available.
2025-09-30 01:07:36 +02:00
Kacper Michajłow cf393b12ac osc.lua: add indicator for buffering/loading 2025-09-29 01:45:47 +02:00
Kacper Michajłow db2b4362c7 vo_gpu_next: add --target-colorspace-hint-strict option 2025-09-27 22:16:59 +02:00
Kacper Michajłow 2a85ac806f vo_gpu_next: respect --target-gamut in colorspace hint 2025-09-27 22:16:59 +02:00
Kacper Michajłow f65a61e488 osdep/w32_register: register url protocols if they don't exist yet
Some protocols may not exist, add them so the mapping to url handler
works correctly. Note that protocols are not removed, only the handler
is. They will remain unassociated, after unregister.

Fixes: #16832
2025-09-27 22:16:36 +02:00
Kacper Michajłow 4499f16215 osdep/w32_register: don't mark io.mpv.url as url protocol 2025-09-27 22:16:36 +02:00
Kacper Michajłow b4c2471174 options: reduce swapchain-depth to 2 by default
It's enough to not wait for the flip and start with next frame and in
the same time minimized latency which helps display-sync modes, that are
not aware about swapchain depth.
2025-09-27 22:15:13 +02:00
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
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
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
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
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
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