Commit Graph

1077 Commits

Author SHA1 Message Date
Kacper Michajłow f220f0fb89 autocrop.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow c5c5a5a2ad test-hooks.lua: fix variable shadowing warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow c431b532b8 status-line.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow 0f7aab534a skip-logo.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow 885cc30596 pause-when-minimize.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow b927857d03 ontop-playback.lua: fix unused variable warning 2024-05-12 20:06:39 +02:00
Kacper Michajłow 50c4b2cd4c observe-all.lua: fix some lint warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow 16c19445bc cycle-deinterlace-pullup.lua: fix unused variable warnings 2024-05-12 20:06:39 +02:00
Kacper Michajłow e47d768d51 command-test.lua: fix some lint warnings
Fixes unused variable warnings.
2024-05-12 20:06:39 +02:00
Kacper Michajłow a1caa00187 autoload.lua: fix some lint warnings
Fixes:

autoload.lua:201:1: setting undefined field filter of global table
autoload.lua:209:1: setting undefined field append of global table
autoload.lua:322:11: value assigned to variable extensions is unused
2024-05-12 20:06:39 +02:00
Kacper Michajłow b4fcf7d248 autodeint.lua: fix some lint warnings
Fixes:

autodeint.lua:90:1: right side of assignment has more values than left
side expects
2024-05-12 20:06:39 +02:00
Kacper Michajłow fabc92453f audio-hotplug-test.lua: fix some lint warnings
Fixes:

audio-hotplug-test.lua:1:7: unused variable utils
audio-hotplug-test.lua:3:61: unused argument name
audio-hotplug-test.lua:5:9: unused loop variable index
2024-05-12 20:06:39 +02:00
Kacper Michajłow 71d9c31394 acompressor.lua: break long lines 2024-05-12 20:06:39 +02:00
Kacper Michajłow a094971ce8 demux_mkv: demux Block Additional Mappings
Parse Dolby Vision configuration.
2024-05-10 01:26:30 +02:00
Matthias Hunstock 5631d83b5f tools: add narrow left arrow glyph for OSD
Add rotated arrow glyph on unused codepoint U+E00D.
2024-05-05 13:47:20 +02:00
Kacper Michajłow 69d70148c7 TOOLS/lua/autoload: make ignore_patterns more generic 2024-04-27 03:14:31 +02:00
oficsu 3ca71b0c0e TOOLS/lua/autoload: allow multiple ignore_patterns 2024-04-27 03:14:31 +02:00
oficsu 96b34148f1 TOOLS/lua/autoload: add ignore_pattern option
Autoload script can now exclude certain files

Why? Sometimes you want to ignore thumbnails,
auto-generated backups or just unwanted files

A non-exhaustive list of real-world examples:
- user backup files: '%.bak%.mp4$' or '^bak-'
- telegram-desktop thumbnails: '_thumb%.jpg$'
- a krita graphics editor backup suffix: '^~'

See documentation here: lua.org/pil/20.2.html
2024-04-27 03:14:31 +02:00
Kacper Michajłow ab3b1744b9 demux_mkv: add BCP 47 language tags support
Section 12 of Matroska Media Container Format Specifications says:

If a BCP 47 Language Element and an ISO 639-2 Language Element are used
within the same Parent Element, then the ISO 639-2 Language Element MUST
be ignored and precedence given to the BCP 47 Language Element.

Fixes: #8144
2024-04-16 19:51:22 +02:00
der richter 919a042833 osxbundle: use arg list instead of a string for signing subprocess call
Fixes #13872
2024-04-15 00:21:59 +02:00
Christoph Heinrich 6a8b130c6f TOOLS/lua/autoload: fix allow extending ext sets from script-opts
4eedb8710c has broken the normal work of this feature with --same_type=yes

Co-Authored-by: dyphire <qimoge@gmail.com>
2024-04-13 23:09:42 +02:00
Dudemanguy 188155457d TOOLS: add an interface-changes generator script
Convenience script to automatically generate interface-changes.rst based
on the workflow introduced in the previous commit.
2024-03-20 22:38:56 +00:00
David Knaack 68fbdc88d2 osxbundle: avoid running `codesign` with deprecated `--deep` argument
`--deep` is deprecated as of macos 13.0.
It is also not supported by alternative `codesign`
implementations like
[sigtool](https://github.com/thefloweringash/sigtool).

Related: https://github.com/NixOS/nixpkgs/pull/270691
2024-03-07 20:43:30 +01:00
der richter a13a674363 osxbundle: activate Game Mode with App bundle
mpv isn't really a game and categorising our App bundle as game seems
counterintuitive. though as a video player it does have some
similarities, possibly needing considerably CPU and GPU resources and
low presentation latencies.

the macOS Game Mode promises exactly that, it gives App the highest
priority access to CPU and GPU resources and lowers usage for background
tasks.

sadly the Game Mode can only be activated by categorising the App as a
game and that is only possible with an App bundle and not as a command
line tool.
2024-03-07 01:16:32 +01:00
der richter 9b301a0537 osxbundle: fix bundling when homebrew is not installed
Fixes #13603
2024-02-29 16:37:21 +01:00
der richter 56b1078bfd osxbundle: use dylib script directly instead of in a subprocess
before errors and outputs where ignored from the subscript and the main
script didn't fail nor did it output anything.

with this change the script properly outputs everything to stdout and
stderr. in the case the dylib script fails the whole script fails now.

the main function in dylib_unhell was kept since it can still be used
individually without the oscbundle script. the script had to be renamed
with an underscore to make it importable.
2024-02-24 20:04:16 +01:00
der richter 00f1743ae2 osxbundle: add homebrew vulkan loader location to search path 2024-02-24 20:04:16 +01:00
der richter 48f48e0d5d osxbundle: resolve loader_path on rpath retrieval
rpaths can be relative to the current object folder path. resolve those
paths.
2024-02-24 20:04:16 +01:00
der richter 98f2dcb676 osxbundle: remove unused import 2024-02-24 20:04:16 +01:00
der richter 948b0487f7 osxbundle: fix syntax warning with python 3.12 2024-02-24 20:04:16 +01:00
der richter d954646d29 various: make mentions of macOS consistent
change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc
consistent. use the official naming macOS.
2024-02-21 20:46:53 +01:00
der richter f9197e07ee osxbundle: add optional source path argument 2024-02-20 20:55:12 +01:00
der richter 166f039edb osxbundle: remove old version retrieval fallback 2024-02-20 20:55:12 +01:00
der richter 6b5b4b74b1 osxbundle: bundle vulkan driver and layers
only bundle synchronization2 layer for older vulkan/MoltenVK versions
where it is needed.

Fixes #13232
2024-02-20 20:55:12 +01:00
Dudemanguy 45f822593f f_auto_filters: change fallback deinterlace to bwdif
I don't actually deinterlace ever but allegedly this is better than
yadif, and there's no real reason to not have this be the fallback
deinterlace when we're not using hw frames. Also change various mentions
of yadif to bwdif. Ref #12835.
2024-01-21 17:55:54 +00:00
llyyr f4a09fada9 TOOLS/autocrop.lua: drop Libav mention 2024-01-20 16:10:20 +00:00
Guido Cella de0849404b scripting: don't observe properties with type nil
mp.observe_property('foo', nil, ...) calls the handler at least 2 times
on each playlist change even when the property doesn't change. This is
dangerous because if you haven't read observe_property's documentation
in a long time this is easy to forget, and you can end up using it for
handlers that are computationally expensive or that cause unintended
side effects.

Therefore, this commit discourages its use more explicitly in the
documentation, and replaces its usages in scripts.

For console.lua, observing focused with type nil leads to calling
mp.osd_message('') when changing file while playing in the terminal with
the console disabled. I don't notice issues from this, but it's safer to
avoid it.

For playlist and track-list this doesn't really matter since they
trigger multiple changes on each new file anyway, but changing it can
avoid encouraging people to imitate the code.

One usage of none in stats.lua is kept because according to b9084dfd47
it is a hack to replicate the deprecated tick event.
2024-01-20 16:09:34 +00:00
sunpenghao b1491bed28 TOOLS/lua/autoload: skip loading when playback is aborted
Quickly going through a directory with too many loadable files causes the
autoload tasks to pile up and exiting the player will take forever. Avoid
this by skipping loading when playback is aborted.
2024-01-20 16:09:12 +00:00
der richter 62b1ce0a55 osxbundle: sign bundle with ad-hoc pseudo identity
without a developer license and the corresponding certificate we can't
sign our app bundle properly. instead use the ad-hoc pseudo identity.
there. i am not sure what restrictions we have because of that, but it's
the only way we can pseudo sign the app bundle.

Fixes #12116
2023-11-15 23:08:11 +01:00
Daniel Brookman aa8af2e66b osxbundle: remove mpv-bundle symlink to allow code signing
Apps on Apple silicon have to be codesigned to run, but you can't
codesign bundles that have a symlink for the main executable.

The "mpv-bundle" symlink was used as the bundle's main executable
because it makes the execution name of the binary different.
Launch Services runs the CFBundleExecutable key from Info.plist when
launching a bundle, so by comparing the execution name to the name of
the symlink, you can check if that's how the binary was launched.

This replaces that detection method by moving the MPVBUNDLE
environmental variable into Info.plist. Launch Services will set
anything in LSEnvironment as environmental variables before launching
the bundle, so we're able to check for it instead of needing to
differentiate the execution name of the binary.

Fixes #12116
2023-11-15 23:08:11 +01:00
der richter dcb3213aa7 osxbundle: resolve relative linked dependency paths
not all dependencies are linked with an absolute path but rather are
relatively linked via @rpath or @loader_path. in those cases we have to
resolve the paths to those dependencies ourselves and change the linking
with install_name_tool to be relative to the @executable_path of the
binary within bundle.

Fixes #11897
2023-11-15 23:08:11 +01:00
der richter 1c98ab6239 TOOLS/macos-sdk-version: remove legacy sdk version retrieval
older macOS dev tools were inconsistent with the way how SDK versions
were returned, some truncated the minor versions. in those cases the
SDK version had to be retrieved through the SDK build version.

recently the scheme for the SDK build version changed that our heuristic
for converting it to an SDK version produced wrong version strings.
the stride of the minor version changed from 1 to 2, so SDK versions
ended up higher than they actually were. furthermore macOS 11 was
hardcoded.

since Xcode 12 Apple fixed the SDK version retrieval and it is no longer
truncated when using Xcode as dev tools. Xcode 12 is also the latest
supported version on macOS 10.15, which is also our oldest supported
version. we can remove the old SDK build version conversation and use
the Xcode only tool to retrieve the SDK version in the case Xcode is
used as dev tools. furthermore this als keeps support for Xcode 11 where
the problem wasn't fixed yet, but is still a supported version on macOS
10.15.

Fixes #9907
2023-11-10 14:28:39 +01:00
Dudemanguy 18885917a7 meson: do the macos sdk version comparison in meson
Since we can no longer rely on distuils for a version comparison, let's
modify the macos-sdk-version script so it returns multiple potential
versions to meson. Then use meson's built-in version comparison to pick
the right one instead. This avoids the complication of needing certain
python packages installed since everything simply uses stdlib functions.
2023-10-29 19:48:43 +00:00
Dudemanguy e76660cc54 TOOLS/{file2string,matroska}: drop unneeded stdout output
This was originally for the waf build, and then later writing the output
to a file was added for meson. Since the waf build is no longer around
anymore, remove the dead code.
2023-10-28 02:39:48 +00:00
Dudemanguy 65806ac4d1 TOOLS/macos-sdk-version: use packaging instead of distutils for version
Python 3.10 deprecated disutils and then removed it in 3.12. The macos
sdk check uses the version compare from there, so it needs to be
replaced with something else. So instead use the API from the packaging
module which is also widely available and a fit replacement.

Fixes #12762.
2023-10-27 18:07:28 +00:00
Kacper Michajłow d305dc8d25 TOOLS/autocrop.lua: disable hwdec when needed instead using -copy one
This is more stable in practice. Avoids switching between possibly
different hwdecs and avoids unnecessary init. Software decoding should be
more stable and possibly faster overall for decoding this small portion
of video needed for cropdetect.
2023-10-18 15:21:34 +00:00
Kacper Michajłow 78719c14ca TOOLS/autocrop.lua: add support for detect_min_ratio
This was lost in 6b963857c0
2023-10-07 22:47:43 +00:00
Guido Cella a08b75da2b TOOLS/autocrop.lua: simplify code
Refactor code that is no longer necessary after replacing vf=crop with
video-crop. There is no change in behavior.
2023-10-07 22:45:38 +00:00
Guido Cella eecba5131a TOOLS/autocrop.lua: update comment 2023-10-06 15:08:19 +00:00
Dudemanguy d147a06e60 TOOLS/lua/autoload: bump the msg-level of some logging
msg.info for when you're potentially adding hundreds of files is way
too spammy and not really useful (autoload loads files, what?). Bump it
up to msg.verbose. Also bump up the previously existing msg.verbose logs
up to msg.debug to keep the difference in log levels. Fixes #12551.
2023-10-03 23:39:42 +00:00