Commit Graph

1039 Commits

Author SHA1 Message Date
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
Guido Cella f4de509f01 TOOLS/autocrop.lua: switch to auto-copy hwdec during cropdetect
I didn't set file-local-options/hwdec because you have to store the
hwdec value to restore it after cropdetect anyway, and if the user
manually changes hwdec after cropdetect, the new value isn't reset when
changing file.
2023-09-21 13:50:21 +00:00
Guido Cella 252347731a TOOLS/autocrop.lua: cleanup timers correctly
If you change file while cropdetect is active and you try to crop the
next video, it fails with "Already cropdetecting!". This is because
timers.detect_crop wasn't cleared correctly, only the timer variable
local to the loop was being set to nil.
2023-09-21 13:50:21 +00:00
Kacper Michajłow 6b963857c0 TOOLS/autocrop.lua: use VO crop always
There is no reason not to and this significantly reduces script
complexity.
2023-09-20 19:08:19 +00:00
Kacper Michajłow 20e584f60b options: make video-crop validation more strict 2023-09-20 19:08:19 +00:00
Kacper Michajłow 008e7db843 TOOLS/matroska.py: add PixelCrop* elements 2023-09-17 16:48:42 +00:00
Christoph Heinrich 3972fd1be4 TOOLS/lua/autoload: rename local variable to lowercase 2023-09-15 21:19:34 +00:00
Christoph Heinrich 43e960e1f6 TOOLS/lua/autoload: pass extensions to recursive call
Closes #12400
2023-09-15 21:19:34 +00:00
dyphire 24cedfec8b TOOLS/lua/autoload: change EXTENSIONS_TARGET to a local variable 2023-09-14 13:40:19 +00:00
dyphire df3a0fa979 TOOLS/lua/autoload: fix specify loading only one type of files
Fixes: 5100e7acba
2023-09-14 13:40:19 +00:00
Christoph Heinrich da400ed3a9 TOOLS/lua/autoload: add directory_mode option
This option behaves the same as the builtin one, and if it's value
is anything other then recursive|lazy|ignore it will fall back on the
builtin one as a sort of "auto" mode. It defaults to that auto mode.
2023-09-13 22:47:59 +00:00
Christoph Heinrich 5100e7acba TOOLS/lua/autoload: add recursive directory loading
Recursion depth has been limited to 20, the same depth the demuxer uses.
2023-09-13 22:47:59 +00:00
Christoph Heinrich 5de1f5ad83 TOOLS/lua/autoload: avoid adding entries to the playlist more then once
Playlist entries should be added at most once, independent of if they
got added by autoload or not.
2023-09-13 22:47:59 +00:00
Christoph Heinrich 6714f6b820 TOOLS/lua/autoload: support directories
Adds support for adding directories to the playlist in addition to
files. The propertiy `directory-mode` controls if directories get added.
Recursive directory loading will get added in a later commit.

Directories get sorted after files to behave the same way mpv
behaves when it loads directories directly.
2023-09-13 22:47:59 +00:00
Kacper Michajłow 10708c13fb autocrop.lua: enable vo_crop mode by default
It is just better way of cropping things. Can be disabled with
script-opts if needed.
2023-09-08 02:27:08 +00:00
Kacper Michajłow f4dd90aa90 autocrop.lua: don't remove crop on startup/exit
No need to remove/clean crop unlike with filters. Allows using autocrop
with auto=false and custom --video-crop.
2023-09-08 02:27:08 +00:00
Kacper Michajłow e234fc0ee5 autocrop.lua: detect if crop is enabled based on prop
Now we can have full frame crop, so to avoid checking that, just check
property.
2023-09-08 02:27:08 +00:00
Kacper Michajłow 817845645f autocrop.lua: use new --video-crop
Gated behind option for backward compatibility.

Note that this will not magically start working with hwdec, as we do not
have crop detection for hwdec.
2023-08-31 17:37:42 +00:00
Kacper Michajłow 3ab5401b38 player/command: remove video-aspect property
4 years is enough of deprecation period.
2023-08-31 17:37:42 +00:00
Christoph Heinrich 4eedb8710c TOOLS/lua/autoload: Enable run-time updates of options
additional_*_exts get parsed and saved as sets in the options themselves
2023-08-19 04:00:25 +00:00
sunpenghao f6fc6cfd35 TOOLS/lua/autoload: may specify loading only one type of files
Under the current file loading logic, a video file and an external
audio track next to it will both be added to the playlist, which
most users don't wish to happen. Having an option that tells the
script to load only one type of files (video, audio, or image)
can avoid this problem. It may also come in handy for people who
have different types of files mixed in a folder but wish to consume
only one type of media at a time.
2023-08-19 04:00:25 +00:00
Dudemanguy 0bed2a2263 build: remove outdated generated directory
This only existed as essentially a workaround for meson's behavior and
to maintain compatibility with the waf build. Since waf put everything
in a generated subdirectory, we had to put make a subdirectory called
"generated" in the source for meson so stuff could go to the right
place. Well now we don't need to do that anymore. Move the meson.build
files around so they go in the appropriate place in the subdirectory of
the source tree and change the paths of the headers accordingly. A
couple of important things to note.

1. mpv.com now gets made in build/player/mpv.com (necessary because of
   a meson limitation)
2. The macos icon generation path is shortened to
   TOOLS/osxbundle/icon.icns.inc.
2023-07-31 19:00:06 +00:00
LaserEyess f2cce5f38f waf: remove waf as a build system
Remove waf entirely in favor of meson as the only supported build
system. Waf was officially deprecated in 0.36.0, and has not been
preferred over meson since 0.35.0.
2023-07-23 19:55:51 +00:00
sfan5 608b430b56 TOOLS: remove obsolete travisCI-related scripts 2023-07-19 13:01:08 +02:00
Dudemanguy 6ed521fd14 TOOLS/idet: fix some outdated cli syntax
d3cef97ad3 changed the way the command
line was parsed and syntax like "--foo value" stopped being considered
valid. This old script still was using the old syntax and thus was
broken. Update it to "--msg-level=ffmpeg=v" which is the recommended
syntax. Fixes #11892.
2023-07-06 22:40:51 -05:00
llyyr 9ad14e0886 TOOLS/lua/autoload: allow extending ext sets from script-opts 2023-07-06 13:42:54 +00:00
Eva 3ba446d0b0 TOOLS/lua/autoload: avoid unnecessary playlist manipulation, performance
We used to sort the playlist with playlist-move after every loadfile.
Instead, append all files in order and call playlist-move once to move
the only entry we don't control the position of.
Don't fetch every playlist item separately, reuse native property.
We used to pick up on new files added to the directory, but only when
playing an entry at the edge of the playlist due to an early return.
New files are now added to the playlist on every file change.
This still works as expected and doesn't load duplicate files on
shuffled playlists or playlists with files manually added after autoload

33% faster on average for my test directory with 1371 files.
2023-07-03 02:41:58 +00:00
Thomas Weißschuh 707554324a TOOLS/docutils-wrapper: handle commands without depfile 2023-03-24 02:18:39 +00:00
Thomas Weißschuh 375e527620 TOOLS/docutils-wrapper: properly propagate failures 2023-03-24 02:18:39 +00:00
Thomas Weißschuh d6f70ef96b TOOLS/docutils-wrapper: gracefully remove non-existing files 2023-03-24 02:18:39 +00:00
Guido Cella 0772d0263c TOOLS/autocrop.lua: log a more accurate warning
This reorders some code and checks the image track-list sub-property
instead of the albumart one, so that when playing audio without enough
playtime-remaining and images, the "autocrop only works for videos."
warning is logged instead of the "Not enough time to detect crop." one.
It also avoids repeating this warning twice in the code.

As of e16d0dd15d current-tracks returns a video track even when
lavfi-complex is used, so the track-list loop in is_cropable can be
replaced with just checking current-tracks/video while still cropping
videos with lavfi-complex.
2023-02-27 17:03:38 +00:00
Kacper Michajłow bc1af592db ci: migrate MSYS2 build to GitHub Actions 2023-01-28 01:03:12 +00:00
Christoph Heinrich 7b09bf7ffc TOOLS/lua/autoload: improve alphanumeric sorting
Currently filenames like `EP.1.v0.1080p.mp4` do not get sorted correctly
(e.g. episode 11 right after episode 1). That is caused by the `.` in
front of the episode number, making it get sorted as if it were
decimals.

The solution is to match the whole real number or integer instead of
matching the integer part and the fractional part separately.

This will regress sorting of numbers with multiple commas where the
length of the individual segments differs between filenames.
Since those are rather uncommon, that is unlikely to be a problem (for
anyone ever).
2023-01-15 16:45:24 +00:00
Dudemanguy 73581d8fe6 TOOLS/docutils-wrapper: make executable + alphabetize
I should have caught this during review but the feature was too cool and
I didn't really pay attention (sorry). For consistency with the rest of
the scripts here.
2023-01-13 10:13:39 -06:00
Christoph Heinrich de9f375a23 TOOLS/lua/autoload: optimize performance of natural sorting
Formatting the string on each comparison is wasteful.
Formatting strings beforehand and then comparing the already formatted
ones leads to a huge performance gain.
2023-01-09 15:01:17 +00:00
dyphire 444bcd43b7 TOOLS/lua/autoload: further optimize the natural sorting
Commits 257dbdf06f uses a algorithm of splitting strings
into a table of number and string values to achieve natural sorting.
This approach works well in most cases, but it does not work well
in some specific scenarios.
Now let's implement natural sorting with a stronger algorithm.

Also fixes indentation.

Ref: 3cf323f3c4
Closes https://github.com/mpv-player/mpv/issues/8969
2023-01-09 15:01:17 +00:00
Thomas Weißschuh 8a0fa62b58 meson: dynamically compute dependencies for manpage and html build
This allows us to rebuild the manpages and html documentation only when
necessary. It is not necessary to manually keep the list of dependencies
up to date.

Unfortunately rst2pdf does not yet support this feature, see
https://github.com/rst2pdf/rst2pdf/issues/1108
2023-01-08 01:55:40 +00:00
sfan5 c8a90001f2 TOOLS/umpv: support shell-quotes in $MPV 2023-01-07 13:16:03 +01:00
SuperSamus 3624a9d3e6 TOOLS/umpv: prefer $XDG_RUNTIME_DIR 2022-11-28 21:08:55 +00:00