1159 Commits

Author SHA1 Message Date
Kacper Michajłow 78159111a8 TOOLS/gen-interface-changes: take every file in the directory
Entries in files with an extension other than .txt were silently left
out of the generated list, which happened to three .rst files in the
0.41.0 release. Collect every file except example.txt and say so in the
release policy.
2026-10-16 23:23:18 +02:00
Fabian Mildner 867990d949 autoload.lua: use efficient file_info call 2026-10-15 19:17:52 +02:00
Fabian Mildner 157cef43d3 autoload.lua: exit early when path is a directory
Before this change, autoload would split a directory path into two,
using the parent directory as the autoload directory. This lead to the
addition of unexpected files to the playlist.

Now, the effective behavior when a directory is given falls back to the
configured mpv directory-mode.
2026-10-15 19:17:52 +02:00
der richter d16053be58 osxbundle: don't exclude libs that have the object file filename in path
this causes problem where the libraries are located in a path that have
the object file filename in the path. example would be custom prefixes
that have "mpv" in the path:

/Users/User/Projects/mpv/build/mpv > /custom/prefix/mpv/libass.9.dylib

instead of checking for the object file filename in the whole path, only
check if it ends with it. this should be the intended behaviour, eg
excluding the already processed libraries.
2026-10-10 13:56:10 +02:00
Ben Boeckel 8e630e008a autodeint: handle detection without video
Log a warning and assume 'progressive' so that callers' codepaths aren't
disrupted with a `nil`.
2026-09-22 14:39:15 +02:00
Kacper Michajłow e167836802 demux/ebml: interpret zero-length elements as their default value
An EBML element is permitted to have a zero-length data payload. It's
then interpreted as the element's RFC declared default value, or zero.

Before this change all zero-length elements were initialized to empty or
rejected in case of uint.

Fixes: #18351
2026-08-14 23:24:50 +02:00
Kacper Michajłow 52bb166f30 TOOLS/matroska.py: use named attributes for optional element fields
Will be useful for next commit.
2026-08-14 23:24:50 +02:00
der richter 28a7932599 osxbundle: fix vulkan loader search path check
the old check stopped at the first occurrence of a vulkan loader path.
though it's possible different vulkan loaders are installed in different
paths, leading to not found vulkan loaders.

to prevent this, also check if the needed vulkan loader is actually
installed to that path.

specific case is when installing MoltenVK and KosmicKrisp at the same
time. the former is installed in the homebrew prefix under etc/ the
latter under share/. the latter wasn't found previous, since the former
was found first.
2026-07-06 18:25:28 +02:00
der richter ed9c05d06e osxbundle: fix a wrong vulkan search path
the paths in the array are meant to be base paths to the vulkan path.
remove vulkan from it so it won't end up as /usr/share/vulkan/vulkan.
2026-07-06 18:25:28 +02:00
Kacper Michajłow 0251783b95 TOOLS/matroska.py: add size constraint for fixed size binary data
Those are fixed size per RFC and read as such in demux_mkv.c, fixes OOB
access in some cases that were missing the checks there.
2026-06-27 18:09:12 +02:00
Kacper Michajłow 8c26c0c1e9 TOOLS/matroska.py: plumb some type hints to make new mypy happy
We don't use strict mode still, so only few are typed.
2026-05-07 14:29:04 +02:00
Kacper Michajłow ed99433277 TOOLS/dylib_unhell.py: simplify the otool output processing
There is no need to pipe things through shell and grep/awk, python is
perfectly fine word processor. This makes it simpler to reason what is
extracted and from where and also makes the script faster as we spawn
only single process directly, not shell with multiple children.
2026-04-26 01:19:27 +02:00
Kacper Michajłow c865008e65 mpv-osd-symbols: center fluent icons only vertically
Makes it nicer for speaker icon to not move around on different volume
levels. Also remove scaling, it was not needed.

This required to rewrite the exclamation mark drawing code, made it look
similar to old icon now.
2026-04-16 19:03:47 +02:00
nanahi b0f9279824 TOOLS/lua/command-test.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
Kacper Michajłow 1d7d6c2719 mpv-osd-symbols: add some Fluent UI System Icons to mpv font
This uses Fluent UI System Icons [1] as a source for icons. The glyps
are generated using `TOOLS/gen-fluent-glyphs.py` script, which downloads
Icon and convert for our mpv font to use. Glyphs are vendored in our
repository to avoid external dependency.

Script could be extended to add more icons/variants easily, currently
only filled version are imported.

[1] https://github.com/microsoft/fluentui-system-icons
2026-03-13 19:14:39 +01:00
nanahi ba30c8c175 player/loadfile: add on_loaded hook
Currently, there is no hook which happens when the playback actually
starts. The on_preloaded hook is insufficient for many cases, as many
track information are unavailable at that stage. This makes it impossible
to act on certain track metadata before the media is shown to the user,
so the user will see the media before action for a brief moment before the
properties are notified and options are changed.

This adds the on_loaded hook which allows the mentioned information
available.
2026-03-08 13:07:05 +01:00
Simon Bruder 534b2d2ea6 {demux,player}: expose original and commentary track flags
Those flags were added to the Matroska specification together with the
already implemented hearing-impaired and visual-impaired flags.

They allow specifying whether a track is a commentary track or in the
original language without relying on the free-form track name, which
makes consistent tagging and parsing by machines easier.

Ref: https://github.com/ietf-wg-cellar/matroska-specification/pull/447
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-original-flag
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-commentary-flag
2026-02-20 20:31:04 +01:00
der richter f93df58a8e osxbundle: add new macOS 26 compatible App icon
generated with the Icon Composer project:

actool ./icon.icon \
  --compile ./ \
  --app-icon icon \
  --enable-on-demand-resources NO \
  --development-region en \
  --target-device mac \
  --platform macosx \
  --include-all-app-icons \
  --minimum-deployment-target 10.15 \
  --output-partial-info-plist /dev/null \
  --standalone-icon-behavior all

actool will generate an Assets.car file which is compatible with all the
new Theme variants of macOS 26 (default, dark, monochrome, tinted, etc).
it also generates an old icns file as a fallback, only default style.

since the new Assets.car file can't be used from cocoa directly, without
using private APIs, we still use the icns file when used from CLI.
this also means that from CLI only the default icon is used and the
macOS theming doesn't have any effect.

the macOS theming mechanism only works with the bundle and a Assets.car
file. all icons are generated on the fly depending on the Theme. this
generation has no public API and the mechanism would need to be
replicated by hand. to replicate this behaviour at least three different
icns would need to be generated, tinting needs to be implemented,
several system events need to be subscribed, and this wouldn't guarantee
the same look as the system mechanism. also none of the tools make it
possible to generate macOS 26 compatible icns file, besides for the
default file, since it at least is missing the necessary padding.
2025-12-21 11:48:52 +01:00
der richter 1b9998a620 osxbundle: make bundle category configurable and default to video
in a13a674363 we set the default category
for the bundle to games, to get certain benefits like better rendering
timing, better bluetooth latency, better threading, etc (bundle only).

though this also prevents low power modes and wrongly categories the app
for spotlight search etc.

set the default category to video and add an option to set the category
to games if one wishes to.
2025-11-05 19:23:26 +01:00
ckath 8364b122ee TOOLS/lua/autoload.lua: stop initial file from being added twice
this happened right after going to the next file
2025-11-04 20:53:35 +01:00
Alex James 0a606d9e18 osxbundle: read version from version.h
osxbundle.py currently reads the version number from MPV_VERSION, while
Meson first tries git describe before falling back to MPV_VERSION.
Update osxbundle.py to try reading the version number from version.h
before falling back to MPV_VERSION. This ensures that the version number
in the bundle matches the output of mpv --version.
2025-11-01 14:41:18 +01:00
nanahi 8410f3157d TOOLS/lua/test-hooks.lua: drop sleep amount suffix
Not POSIX.
2025-10-27 20:00:59 +01:00
LordMZTE f9d4e19888 TOOLS/lua/gamma-auto: update on timer when on Linux
The Linux implementation of ambient-light is not observable.
2025-10-15 21:59:42 +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
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
der richter e867518bdd osxbundle: add new vulkan loader homebrew path
see https://github.com/Homebrew/homebrew-core/commit/0c6a7238e7c3457af8d2cc7a997a3d2732ab2751
2025-03-06 17:31:17 +01:00
Kacper Michajłow 48f944d21b TOOLS/umpv: add Windows support
While there are native ways to implement this in mpv itself on Windows.
We can also support this script without any problem.
2025-02-05 20:22:01 +01:00
Kacper Michajłow f9a7179f37 TOOLS/umpv: use append-play
It makes more sense to star playback if nothing is playing.
2025-02-05 20:22:01 +01:00
Kacper Michajłow dfbd60f9bb TOOLS/umpv: don't wait for mpv after it is run
We just want to start mpv, there is no need to keep umpv script alive.
2025-02-05 20:22:01 +01:00
Kacper Michajłow b870d1933a TOOLS/umpv: use builtin profile for pseudo gui options 2025-02-05 20:22:01 +01:00
Kacper Michajłow 62847c9f39 TOOLS/umpv: handle the case when mpv disappears during adding files 2025-02-05 20:22:01 +01:00
Kacper Michajłow 7372bc5f12 TOOLS/umpv: minor fixes to style and typing
Add UMPV_SOCKET_DIR for socket base dir selection and fallback to TMPDIR
as last resort.
2025-02-05 20:22:01 +01:00
Leo Izen a7357c221e TOOLS/mpv_identify.sh: handle forward slash in property names
Property names contain '-' characters, which are translated into
underscores because POSIX shell variables cannot contain hyphens.

We should do the same thing for forward slash characters (i.e. '/')
because these also cannot be present in the names of shell variables.

Fixes: #15782
2025-02-05 04:54:04 +01:00
Guido Cella e07c78f2db TOOLS/mpv-osd-symbols.sfdir: add a menu icon
Taken from the last freely licensed version of Symbola and manually
adjusted the number in the glyph file to match the adjacent arrows.

Saving sfdir with fontforge also automatically removed the O flag from 2
existing glyphs. According to
https://fontforge.org/docs/techref/sfdformat.html "O" just meant "the
character was open when last saved", so it doesn't change anything
visible.
2025-01-27 21:06:50 +01:00
Guido Cella 118ef75c27 TOOLS/mpv-osd-symbols.sfdir: document how to add icons 2025-01-27 21:06:50 +01:00
Kacper Michajłow e8fa2a7aaa TOOLS/osxbundle: fix inplace argument type 2025-01-25 02:35:54 +01:00
Kacper Michajłow 805793154d TOOLS/macos-sdk-version: check if xcodebuild is defined
Makes mypy happy.
2025-01-25 02:35:54 +01:00
Kacper Michajłow 37b513a760 TOOLS/file2string: use array of tuples to avoid unpacking strings 2025-01-25 02:35:54 +01:00
Kacper Michajłow da2880fb54 TOOLS/dylib_unhell: check regex search result 2025-01-25 02:35:54 +01:00
Kacper Michajłow 2d5c5030e5 TOOLS/stats-conv: typing fixes
To make mypy happy. PyQtGraph doesn't define types, so ignore those.
PyQt6 has types, but we use only one function from it, so to avoid
installing it, ignore it too.
2025-01-25 02:35:54 +01:00
Kacper Michajłow 59afdf2ef8 TOOLS/gen-mpv-desktop: don't overlap variable with different types 2025-01-25 02:35:54 +01:00
Kacper Michajłow 4cf914d44d TOOLS/gen-interface-changes: fix variable type mismatch 2025-01-25 02:35:54 +01:00
Kacper Michajłow 59d1dc43b9 various: fix typos 2025-01-04 15:59:49 +02:00
der richter e0f82b1a77 gamma-auto.lua: add this script as replacement for --gamma-auto
also mention this replacement for --gamma-auto.
2024-12-21 16:15:44 +01:00
Guido Cella 1b53793a4c various: convert tabs to spaces 2024-10-18 18:32:26 +02:00
Kacper Michajłow baabc291f1 build: fix dynamic generation of mpv.desktop file protocols
Running cross-compiled binaries may be possible, but the runtime
environment must be configured correctly. In some configurations, an
exe_wrapper needs to be used, and in all cases, the library path must be
set correctly for the given binary. Fortunately, Meson handles all of
this if cross-compilation is configured correctly.

Fix this by having Meson run the mpv binary directly, instead of as a
subprocess of a Python script. This ensures that the environment is
properly set for running host binaries, if possible.

Fixes: #15075
Fixes: 056b03f9ed
2024-10-14 01:56:25 +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