Commit Graph

51256 Commits

Author SHA1 Message Date
Kacper Michajłow bc3e850168 scripting: add 'script' to messages 2023-10-27 23:18:56 +00:00
Kacper Michajłow 6bb3e05d49 scripting: rename backend names for concise naming 2023-10-27 23:18:56 +00:00
Kacper Michajłow cb829879af mp_threads: rename threads for consistent naming across all of them
I'd like some names to be more descriptive, but to work with 15 chars
limit we have to make some sacrifice.

Also because of the limit, remove the `mpv/` prefix and prioritize
actuall thread name.
2023-10-27 23:18:56 +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
NRK 8bbcc87fee timer: remove MP_START_TIME
instead require mp_raw_time_ns() to not return 0, which all current
implementation already should follow.
2023-10-27 18:07:19 +00:00
Kacper Michajłow 2f91e1441e player/lua: use mp_msg_find_level in check_loglevel
Fixes off by one error. Allows to use MSGL_STATS, but since this is
internal value, this is mostly cosmetic change.
2023-10-27 18:07:08 +00:00
Kacper Michajłow 29e677fea5 msg: make mp_msg_find_level case insensitive 2023-10-27 18:07:08 +00:00
llyyr 78f1cedd0c DOCS/options: clarify `no-config` is a command line flag
This option does nothing when put inside config files.
2023-10-27 11:19:32 +02:00
Dudemanguy 66fb1d1cdb player/audio: fix incorrect check on adding delay
dac977193c changed adding delay to only
when the video is playing but this isn't correct. The video frames
adjust themselves based on the audio, so if we still have audio
processing while the video itself happens to be in some non-playing
state (such as STATUS_READY), the delay still needs to be taken into
account. The correct thing to check is to make sure that it is not
STATUS_EOF. STATUS_EOF covers the case where we have still image, and of
course no video at all is STATUS_EOF. So having a massive bogus delay
value is still avoided.
2023-10-26 22:59:09 -05:00
Kacper Michajłow 729f2fed2c semaphore_osx: change mp_sem_timedwait to mp_time 2023-10-26 20:06:14 +00:00
Kacper Michajłow f659a60dfa semaphore_osx: don't overwrite global symbols 2023-10-26 20:06:14 +00:00
Philip Langdale 7a58763ad9 Revert "hwdec_vulkan: account for vulkan frames now using presentation size"
ffmpeg is again setting the frame dimensions to the coded size, so we
need to reintroduce our work-around to get the logical frame dimensions
from the frames_ctx rather than the frame itself.

ffmpeg commit:
* 9ee4f47c94

This reverts commit c40bd88872.
2023-10-26 09:51:47 -07:00
Dudemanguy b9c42755a7 javascript: use --js-memory-report option instead of MPV_LEAK_REPORT
The MPV_LEAK_REPORT environment variable was previously read in order to
determine whether or not to enable memory reporting for javascript
scripts. This is kind of weird and deviates from the norm of exposing an
option to the user. So let's just add --js-memory-report and disable it
by default instead.
2023-10-26 16:49:56 +00:00
Kacper Michajłow 1be0d0aa84 test: unbreak build when win32-internal-pthreads is disabled 2023-10-26 16:49:46 +00:00
Kacper Michajłow 34d99840a5 timer: use MP_TIME macros 2023-10-26 16:49:38 +00:00
Kacper Michajłow 032b7de97f osdep/timer-win2: rename to timer-win32 2023-10-25 19:30:39 +00:00
llyyr 54223fc8e7 ci/msys2: create a wrap file for libplacebo
This is required because msys2's libplacebo is too outdated
2023-10-25 16:40:02 +00:00
llyyr 486bb93dfa meson: remove libplacebo wrap
This causes more pain than it is worth
2023-10-25 16:40:02 +00:00
Dudemanguy 2783d5a51a options: rename --play-dir to --play-direction
--play-dir sounds like it has something to do with directories so change
it. The play_dir variable is used a bunch everywhere internally so
whatever just leave it alone instead of renaming that.
2023-10-25 16:16:37 +00:00
Dudemanguy 36de0d784f options: rename --watch-later-directory to --watch-later-dir
Same logic as the previous commit.
2023-10-25 16:16:37 +00:00
Dudemanguy 1370ecfc1b options: rename --screenshot-directory to --screenshot-dir
Less characters is better? Other options use -dir for directory so
consistency I guess.
2023-10-25 16:16:37 +00:00
Dudemanguy b626f3ba83 options: rename --sub-ass-force-style to --sub-ass-style-overrides
This option has exactly the same semantics are other mpv options that
override a particular thing with something from the user. So instead of
the "force-style" name, use "-overrides" which is more consistent.
The plural form is used since it's a list option.
2023-10-25 16:16:37 +00:00
Dudemanguy 9924102c66 options: rename --override-display-fps to --display-fps-override
Other similar options are in the form of --foo-override not
--override-foo. The display-fps one was backwards so flip it around the
other way for consistency reasons.
2023-10-25 16:16:37 +00:00
Dudemanguy 7aed492ccc options: rename --fps to --container-fps-override
This better reflects what it actually does. As a bonus, script writers
won't be misled into thinking that fps displays the actual video or
display fps.
2023-10-25 16:16:37 +00:00
Dudemanguy dac977193c player: don't calculate av delay if there's no audio or video
The point of the mpctx->delay field is for calculating a/v sync and
adjusting the frame timings appropriately. However, the frame_time was
always subtracted from mpctx->delay regardless of the audio status. This
meant that for a video with no audio, every single frame had a
subtraction with nothing ever added to it meaning that you get massive
negative delay times. For weird videos where the audio starts way later,
the massive delay leads to the VO sleeping for basically about as long
as the video was previously playing without audio. This results in
nothing being rendered during that brief period of time and just overall
badness. When using display-sync, it happens to work since the video
doesn't adjust itself based on audio and it renders anyway.

The fix is to simply not touch mpctx->delay in player/video.c unless
there's actually audio playing. This is what the rest of the code
already does aside from setting it to 0 on resets or EOFs. Move the
calculation into adjust_sync after the audio status check. It works
exactly the same as before except that we don't constantly subtract
bogus values when there's no audio playing. The reverse situation in
player/audio.c also has the same issue. For something that is only
audio, mpctx->delay is always added to but nothing will ever subtract
from it. It's not really clear if this particular version could ever
cause a real bug, but logically it needs to be guarded in the same way.
The field here should only be updated if the video is actually playing.

Fixes #12025.
2023-10-25 15:43:07 +00:00
Guido Cella c62adc3018 console.lua: complete choice and flag options 2023-10-25 15:42:33 +00:00
Guido Cella 4aa8b628e4 console.lua: remove unused capture from completion patterns
The end position of the word to be completed is never used because all
patterns end with $. Remove it or it would complicate implementing
completers with more patterns.
2023-10-25 15:42:33 +00:00
Guido Cella c4368dc08d console.lua: use string.match()
Avoids the 2 unneeded return values of string.find().
2023-10-25 15:42:33 +00:00
Guido Cella e92d794644 console.lua: generate completion lists lazily
This will allow providing more nested completions without pre-generating
an enormous amount of completions, and it is more efficient since it
only generates the completions needed for each completion attempt.
2023-10-25 15:42:33 +00:00
Guido Cella b89f0ad411 console.lua: remove repetition from build_completers() 2023-10-25 15:42:33 +00:00
Guido Cella b9ab8d1a6c console.lua: remove unnecessary copy 2023-10-25 15:42:33 +00:00
Kacper Michajłow 48ac5215cf github/workflows: use ubuntu-latest host for freebsd
In the pursuit of stability.

It is slower and QEMU-based, but if this isn't stable, I don't know what
will be.

Bump the timeout to 30 minutes, just in case. It seems to take 12-15
minutes to finish.
2023-10-25 13:51:20 +00:00
Kacper Michajłow 869faadc68 options: disable --allow-delayed-peak-detect by default
Peak detection greatly increases HDR experience. Performance hit of
non-delayed detection is not that significant and is in line with
current default settings.
2023-10-25 11:55:56 +02:00
llyyr 06c26e37ed osdep: fix clang warnings with `_FORTIFY_SOURCE`
This fixes warnings generated for `-Wunused-result` when mpv is built
with `-O1 -D_FORTIFY_SOURCE=1` or higher on clang since read/write
functions are declared with the `warn_unused_result` attribute.
Cast to void to avoid these warnings.
2023-10-24 22:49:22 +02:00
Kacper Michajłow 36403e5fd3 github/workflows: use macos-13 host for freebsd
Maybe macos-13 runners will be more stable?
2023-10-24 20:50:55 +03:00
llyyr 60e9ac6b5d README: bump macOS version as a consequence of libplacebo version bump
We require libplacebo 6.338 or newer, which currently doesn't support
macOS 10.14 or older. Consequences of progress
2023-10-24 14:06:37 +00:00
llyyr 6413f9e84f README: add libplacebo to dependencies and mention wrap 2023-10-24 14:06:37 +00:00
sfan5 3af25edfa5 Revert "audio: don't block on lock in ao_read_data"
It was found that this causes issues with at least ao_coreaudio,
essentially revealing a way bigger issue:
Some AOs don't check for 0 and/or have no way to deal with short writes.
Someone will have to figure out a fix later but get rid of the direct
cause for now.

This reverts commit ae908a70ce.
2023-10-24 10:38:07 +02:00
Kacper Michajłow 4de76ce87a osdep/meson: add libplacebo include dir to swift compile 2023-10-24 01:30:22 +00:00
Kacper Michajłow 2f5f15039d test/meson: add missing libplacebo dep 2023-10-24 01:30:22 +00:00
Dudemanguy 7847f15ee2 sub: update subtitles if current track is an image
Any track that has attached picture is also always considered an image.
Not every image is neccesarily an attached picture though. So change the
check here to capture more possible cases where we should be updating
the subtitle. With the previous commits, this fixes #12387.
2023-10-23 19:32:53 +00:00
Dudemanguy 4709a94aec demux_mkv: check if the video codec is an image
Add a simple helper to codec_tags to check if the codec name matches one
of the images. If so, then we set still_image and image in the stream as
true (slightly different semanatics).
2023-10-23 19:32:53 +00:00
Dudemanguy be0a979a0b demux: put type2format into codec_tags with helper functions
demux_mf has a big const struct which is essentially a nice list handy
list of codecs that are considered images. This is generally useful for
all demuxers (demux_mkv could use this), so instead of making yet
another list, lift it out and put it in a common place. Some things
slightly changed so it matches the very similiar mimetype mapping struct
below it. demux_mf calls a helper mapping function instead.
2023-10-23 19:32:53 +00:00
Dudemanguy 1ea106bac0 ci/freebsd: disable iconv
This actually started having a linking error a few days ago, but the ci
never actually actually exited 1 for some reason so it was never caught.
The actual commits where this started happening are unrelated (reverted
all of the them to be sure) and there's no other obvious things like a
meson update that would cause this. All I can assume is some other
package within BSD itself, but I can't be bothered to debug it. Anyways,
just disable iconv in the build for now so the CI stops failing.
Presumably there's something wrong in the environment with GNU's
libiconv and the built-in one clashing somehow. Also, sdl unbelievably
defines HAVE_ICONV in their public header so we have to disable that
too.
2023-10-23 19:23:48 +00:00
Dudemanguy 71a497deee github/workflows: use cross-platform-actions for freebsd
Since vmactions is basically a bootlooping disaster* with no signs of
life from upstream, let's try a different action instead and hope it
works better. We don't need to force the latest release channel, so
delete that part. Also make the pkg install just one command for
simplicity.

*: https://github.com/vmactions/freebsd-vm/issues/74
2023-10-23 19:23:48 +00:00
Kacper Michajłow 7d63b81cf1 ci: disable Werror for libplacebo subproject build 2023-10-23 20:35:13 +02:00
Kacper Michajłow bfb10a8e86 ci/msys2: disable autocrlf
I won't even comment how terrible this option is and why in 2023 default
is not at least `autocrlf=input`.

Disable the conversion to CRLF. We build everything in MSYS2 sysroot,
which supports/expects LF. While the checkout itself is done with
actions/checkout@v3 and this causes problems.
2023-10-23 20:35:13 +02:00
Kacper Michajłow 9ade565a7c gitignore: update for meson wraps 2023-10-23 20:35:13 +02:00
Kacper Michajłow 1805681aab m_option: initialize m_option_value union properly
C standard says that `= {0}` activates and initializes first member of
union. We expect whole union to be zeroed, it is used as default value.

Initialize union with one zeroed default instance to ensure proper init.

Fixes: #12711
2023-10-23 20:33:51 +02:00
llyyr 9074436862 workflows/build: install git in freebsd image
for downloading libplacebo.wrap via git
2023-10-23 13:03:29 +02:00