1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 12:17:12 +00:00
Commit Graph

53160 Commits

Author SHA1 Message Date
Guido Cella
e34f6569ee stats.lua: rename a variable 2024-10-12 21:24:41 +02:00
Dudemanguy
63a81515ad stream_cdda: stop suppressing -Wscript-prototypes
This was fixed upstream* and in a new release, so it is no longer needed
for our CI.

*: 3ced3d72de
2024-10-12 15:56:51 +00:00
Misaki Kasumi
6fadaf66c8 osdep: remove semaphore-mac
It is only used in one place in ao_coreaudio_utils.c,
and can be replaced by condvar.
Removing it can reduce the maintenance burden.
2024-10-12 17:26:39 +02:00
Julian Orth
1821c065b1 wayland: use wp-presentation v2 if available
Version 2 allows the compositor to send an appropriate refresh rate if
the output uses VRR. There are no changes to the API. Since mpv would
otherwise use a heuristic based on the last-seen output, it does not
matter to mpv if the output uses VRR.

https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/320/diffs
2024-10-12 13:59:14 +00:00
Kacper Michajłow
3c57b395d3 hwdec_vaapi: try format upload lazily
Uploading all available formats has proven to be problematic because
more unusual ones can crash the driver, even when no upload is
necessary. Check the upload only if needed to avoid issues with broken
drivers.

This also might speedup the init process.

Fixes: #14956
Fixes: #15030
2024-10-12 01:36:44 +02:00
Kacper Michajłow
39d3591bb2 msg: strip control char also when not printing to terminal 2024-10-12 01:26:43 +02:00
Kacper Michajłow
65c81c3a39 vo_gpu_next: suppress tone_mapping_param deprecation warning
It is not going anywhere soon.

Fixes: #14696
2024-10-12 01:08:36 +02:00
Guido Cella
ba3b4eda64 console.lua: use ${term-clip-cc} to clip lines
Instead of considering every non-ASCII character 2-cell wide, use this
newly introduced property to let msg.c clip the select menu using all
available with.
2024-10-11 15:31:17 +02:00
Kacper Michajłow
bf025cd289 msg: allow to truncate the message to terminal width 2024-10-11 15:16:33 +02:00
Kacper Michajłow
95f0046309 misc/codepoint_width: add unicode width detection support
Add 4 stage trie to lookup unicode codepoint width and grapheme join
rules.

Generated by GraphemeTableGen from Microsoft Terminal (MIT Licence):
a7e47b711a/src/tools/GraphemeTableGen/Program.cs

With minor adjustment to use it in C codebase.
- Replaced constexpr with static
- Replaced auto with explicit types

Generated from Unicode 16.0.0:
ucd.nounihan.grouped.xml: sha256(b11c2d23673bae660fff8ddcd3c1de4d54bdf6c60188a07696b010282f515fcf)
2024-10-11 15:06:14 +02:00
Kacper Michajłow
fa77ad46cb win32: always fit to the screen on initial positioning
VO_WIN_FORCE_POS is set even if the position is not provided by the
user, so we have no choice but to always fit. We should do this
regardless, and if any issues occur in multi-monitor configurations,
they should be addressed separately.

Fixes: #15049
Fixes: e5159de811
2024-10-11 13:26:31 +02:00
Kacper Michajłow
3b95c00d96 ci/win32: add libjxl
For JPEG XL support.
2024-10-10 18:53:22 +02:00
norinoriko
ee4402feca DOCS/man/options.rst: add gpu-next differences to --scale-antiring 2024-10-10 18:52:40 +02:00
Kacper Michajłow
e5159de811 win32: center geometry, but only at start
I must have misunderstood the intent of the previous commit. Adjusted to
always center on window initialization.

Fixes: #15043
Fixes: e01eab4385
2024-10-10 18:50:08 +02:00
Kacper Michajłow
ac7e9247b2 vulkan/context: make use of VK_EXT_shader_object only if available
VK_EXT_shader_object was added in 1.3.246, mpv currently requires
1.3.238. Debian stable is at 1.3.239.

Fixes build on Debian stable (Bookworm).

Fixes: #15041
Fixes: 2ac1d6db32
2024-10-10 18:37:22 +02:00
Crend King
c8860fd816 ytdl_hook.lua: always specify --write-srt
Currently by default mpv sets --all-subs when calling yt-dlp for JSON
info. --all-subs is an option that simply expands to --sub-langs all
--write-subs. --write-subs is special that without it yt-dlp will no
longer extract any subtitle info.

mpv's yt-dlp hook has a logic that if user specify any sub-langs in
--ytdl-raw-options, it no longer uses --all-subs. Unfortunately, this
means unaware users will not get any subtitle any more until they study
the mpv internal code and add their own --write-subs.

This PR always specifies --write-srt, an alias of --write-subs, in the
hook, so users don't have to. The alias is used to maintain
compatibility with youtube-dl.

Fixes issue #14818
2024-10-10 18:28:41 +02:00
Kacper Michajłow
3df68c5807 options: mark sub-lavc-o as UPDATE_SUB_HARD
To properly update lavc options it may be required to reinit sub
decoder, so mark this option as UPDATE_SUB_HARD.
2024-10-10 16:24:09 +02:00
Dudemanguy
901b9bc888 player/sub: ensure subtitles are updated for images with no audio
The video_pts condition here would bail out on still images with no
audio since their pts is always MP_NOPTS_VALUE. This is not exactly
great because the subtitles may need to be updated so just let these
files also go through the subtitle redraw logic below.
2024-10-10 13:17:47 +00:00
Dudemanguy
5bf9cf5bf0 test: only run ffmpeg tests on release versions
The CI breaking because some new format was added in the master branch
is pretty annoying so only run these on release versions that are known
to work to reduce some maintenance burden. Although why we even bother
with this is still a valid question.
2024-10-10 13:17:29 +00:00
Kacper Michajłow
e09278cfb9 win32: set consoleAllocationPolicy to detached in the manifest
This essentially obsoletes the console wrapper (mpv.com), which is no
longer needed. The console is attached depending on the context in which
mpv.exe is run.

Add an option to control which subsystem is targeted. Keep the GUI
application as the default to preserve compatibility with Windows
versions prior to 24H2.

For more information about the new console handling, see:
4386bf07fd/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md
2024-10-10 00:44:15 +02:00
Dudemanguy
48963aef4b vo_gpu_next: force a reset when --image-lut is updated
Bit of an edge case since image-lut requires the frames to be remapped
again so the normal redraw when paused doesn't work. Also we use
update_options in the VOCTRL here.
2024-10-09 13:39:06 +00:00
Kacper Michajłow
6da3a15ca8 win32: keep prev_windowrc consistent also for maximized state 2024-10-09 04:09:13 +02:00
Guido Cella
6ed3781a3d ytdl_hook.lua: add include script-opt of URLs to try with ytdl first
By the default mpv tries opening URLs with ffmpeg first, and users who
don't configure try_ytdl_first get a slower startup for youtube URLs, on
top of yt-dlp already being slow.

Fix this by adding a script-opt of URL pattern to try with ytdl first.
Youtube and twitch are included by default.

Compared to the alternative of trying ytdl first by default and
excluding URLs with a media extension, this only works for the sites
explicitly included in the new option's value, but doesn't have false
positives on media URLs without an extension.
2024-10-09 01:08:31 +02:00
Guido Cella
92403a068c ytdl_hook.lua: lower case URLs for exclude matching 2024-10-09 01:08:31 +02:00
Mohammad AlSaleh
28a4e19a67 command: avoid division by zero in av_timecode_make_string()
`av_timecode_make_string()` divides by fps unconditionally. And
 relying on container_fps always carrying a meaningful value was
 misguided. So we now check that fps is non-zero before calling that
 function.

 Issue encountered with a couple of old FLV files triggering a segfault.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-10-09 00:36:35 +02:00
Lynne
2ac1d6db32 vulkan/context: use VK_EXT_shader_object if available
FFmpeg has patches which add support for it.
2024-10-08 11:48:22 -07:00
Guido Cella
8bf5548589 console.lua: allow clicking selectable items
This adds click support for the select menu. Scrolling with the wheel
already worked.

If a custom OSC binds a button to a select.lua script-binding, this lets
users keep using the mouse to select an item.

While the OSC and the select menu are open at the same time, you can no
longer click the OSC's buttons. By using mp.add_key_binding instead of
add_forced_key_binding you could click both, but the console's binding
would be shadowed by MBTN_LEFT bindings in input.conf.
2024-10-08 20:37:56 +02:00
llyyr
6871304029 wayland: replace old keymap if we receive a new keymap event
Fixes: 2274311b25
Fixes: #15022
2024-10-08 20:06:41 +02:00
Kacper Michajłow
c201c4874d demux_playlist: ensure the file is added to autocreated playlist
Even if it doesn't match extensions in filter mode.
2024-10-08 19:57:16 +02:00
Kacper Michajłow
946b29d4f4 ci/macos: shift macOS versions to 13-15
Homebrew does support 3 latest macOS versions, so while macOS 12 still
works it takes 1h 40m 7s to build. It is bit too much...

While we drop macOS 12, add macOS 15 as it is available now.
2024-10-08 18:35:44 +02:00
Kacper Michajłow
fb9ac9b570 win32: don't change window size on video reconfig when maximized
Fixes: #7265
2024-10-07 09:41:40 +02:00
Kacper Michajłow
6667b9723e win32: fix window size restore after maximize state
This remembers and sets window-scale when exiting maximized state. Also
fixes not staying in maximized state when exiting fullscreen mode.

Fixes: #14126
2024-10-07 00:45:11 +02:00
Nathan Ruiz
62abcbdd88 ci/lint: fix missing return value in lint-commit-msg 2024-10-06 22:15:08 +02:00
Nathan Ruiz
44a296be97 ci/lint: add flake8-commas check 2024-10-06 22:15:08 +02:00
Nathan Ruiz
c6903f9963 ci/lint: add isort checks 2024-10-06 22:15:08 +02:00
Nathan Ruiz
416035a174 ci/lint: check for pep8 naming convention 2024-10-06 22:15:08 +02:00
Nathan Ruiz
1562895af7 ci/lint: add pyupgrade check 2024-10-06 22:15:08 +02:00
Nathan Ruiz
8a82882d5e ci/lint: ensure double quotes are used in python 2024-10-06 22:15:08 +02:00
Nathan Ruiz
e5a383a525 ci/lint: enable pyflakes and pycodestyle checks
This change required some minor rework to make the code conform to the
following:
- Restrict line length to 88 character
- Use spaces rather than tabs (only affect ci/lint-commit-msg.py)
- Use f-strings rather than % formatting or `str.format()`
2024-10-06 22:15:08 +02:00
Nathan Ruiz
bee3598ba6 ci/lint: add python linting
Enabled the ruff python linter in CI, and resolved the issues that were
detected by it. Ruff was used due to it's faster checking compared with
other linters like pylint. This was added to resolve the python linting
request in #13608.
2024-10-06 22:15:08 +02:00
nanahi
f46975c2d2 mp_image: restore dovi metadata before converting to AVFrame
They should be passed as side data instead.
2024-10-06 22:01:37 +02:00
nanahi
e2365bfece vf_format: set original params when converting format
Otherwise it will restore to a format before vf_format conversion when
restoring params. Only do this when the out format isn't dolbyvision.
2024-10-06 22:01:37 +02:00
nanahi
e35a559ce1 mp_image: only restore params when image is dolbyvision
Should be no need to do so otherwise.
2024-10-06 22:01:37 +02:00
nanahi
9b571a7aa7 mp_image: copy params before dovi mapping for mp_image_copy_attributes
It currently doesn't copy original params before mapping, resulting in
wrong colors when some video filters are used, e.g. d3d11vpp=scale.
2024-10-06 22:01:37 +02:00
der richter
7bd612ee66 mac: remove unnecessary window size change check
this is already done in the updateSize method of the window.

also fixes an issue where the size wasn't properly changed, even though
the new and old size were different. the unfsContentFrame should have
been checked instead of the pixel representation of the same frame.
2024-10-06 21:53:08 +02:00
der richter
c5324cc483 DOCS/input: clarify display-names naming on macOS
this was meant to refer to round brackets and not square brackets.
2024-10-06 21:53:08 +02:00
der richter
94d034ed99 mac/swift: fix typo in mpv_event_id string representation
this didn't break anything but might be confusing in log outputs.
2024-10-06 21:53:08 +02:00
der richter
20b7f96ab3 meson: error out when swift unavailable or disabled and cplayer enabled
without swift mpv as a standalone app is unusable on macOS, since the
cocoa main main loop doesn't exists. furthermore most of the other
needed functionalities like video outputs, contexts, platform features,
etc are also missing.

without swift mpv is really only usable as libmpv.
2024-10-06 21:52:35 +02:00
der richter
2fb8b00ac9 mac/app: fix building with swift disabled
Fixes #14931
2024-10-06 21:52:35 +02:00
Kacper Michajłow
f7a895e7c1 docs: remove stray newlines 2024-10-06 21:51:59 +02:00