Commit Graph

51091 Commits

Author SHA1 Message Date
Claude Heiland-Allen a6d1c9dd0f common/tags: add mp_tags_move_from_av_dictionary()
Abstracts a common pattern,
in which the av dictionary is cleared
immediately after copying to mp tags,
so that additional tags later in the stream
get appended to empty tags,
instead of being appended to existing tags
that were already copied.
2023-10-18 16:52:47 +02:00
Kacper Michajłow 02d009bc5c player/command: truncate anything < 1e-4 in pretty printer
To avoid switching to scientific notation. Apparently it is "jarring"
for some users.

This preserves status quo from before 9dddfc4f where pretty printer were
truncated to 3 decimal places.
2023-10-18 11:34:52 +02:00
Dudemanguy 11bbb49bdf wayland: use ppoll if possible
Since the previous commit unbreaks the timeout, this now actually works.
Imagine that.
2023-10-17 15:05:33 +00:00
Dudemanguy b8950f8d95 poll_wrapper: use the actual correct timeout for ppoll
It's not absolute time. Fixes #12660.
2023-10-17 15:05:33 +00:00
Guido Cella 4a46e4ee02 DOCS/options: remove obsolete notice
This may have been true 10 years ago but now reset-on-next-file can
definitely reset options that weren't explicitly set.
2023-10-17 15:01:19 +00:00
Guido Cella 98eab5b678 DOCS/mpv: fix typos in List Options 2023-10-17 15:00:56 +00:00
Guido Cella 16d9d3b273 DOCS/interface-changes: remove redundant change
directory-mode's default was changed again to auto afterwards.
2023-10-17 11:03:25 +02:00
Philip Langdale 71cf360e33 hwtransfer: handle hwcontexts that don't implement frame constraints
Some ffmpeg hwcontexts do not implement frame constraints. That means
they cannot report which formats are support for given configurations.

My previous changes to make hwupload more capable relies on the
constraints to be provided to accurately describe what combinations are
supported, so we will currently see a bunch of errors failing to
configure the hwupload filter on platforms such as v4l2 SoCs with
drmprime. This doesn't break playback, but it's confusing.

To bridge the gap, this change uses the static format metadata that we
include for hwdecs to build a fake constraints struct to keep all the
other code working.
2023-10-16 20:15:09 -07:00
Jan Ekström ad0017f8b9 github/workflows: remove macOS 11 build
Homebrew has finally given up supporting macOS 11, and all updated
dependencies are being built locally. Additionally, python3.12 - being
a dependency of libass in Homebrew - seems to completely fail under
cairo's meson usage on macOS 11, even if we let it build.

Thus, finally remove macOS 11 from our macOS build matrix, leaving
12 and 13.

ref: Homebrew/brew#16019
2023-10-16 21:31:59 +02:00
Dudemanguy 8f432b2e37 timer: remove microsecond timer functions
With the previous series of commits, all internal usage has been
replaced by the nanosecond functions. There's not really any point in
keeping these around anymore plus there are macros for unit conversions
now so we can just axe them. It's worth noting that mpv_get_time_us()
obviously still needs to work for API reasons, but we can just divide
mp_time_ns() by 1000 to get the same thing.
2023-10-16 15:38:59 +00:00
Dudemanguy bb036c67f4 test: change test_utils stubs to ns variants
The functions now internally use the ns timer and not the us one.
2023-10-16 15:38:59 +00:00
Dudemanguy 917bdf1b5c dither: removed some unused code
Added in 58a7d81dc5. Nobody touched it
since then, so it's probably useless. libplacebo has its own dithering
stuff anyways.
2023-10-16 15:38:59 +00:00
Dudemanguy 39b9635305 vo: convert some final low-hanging things to nanoseconds 2023-10-16 15:38:59 +00:00
Dudemanguy 92976b1e8c client: change underlying mpv_wait_event timer to nanoseconds
No change in the actual API.
2023-10-16 15:38:59 +00:00
Dudemanguy 9ac0085031 dispatch: change mp_dispatch_queue_process timer to nanoseconds
The playloop is the only thing that adjusts the timeout with a value
other than 0, so nothing else needs to be changed.
2023-10-16 15:38:59 +00:00
Dudemanguy 0fd8f0b3c1 input: convert autorepeat timing to nanoseconds 2023-10-16 15:38:59 +00:00
Dudemanguy 635674a4a0 filters: change end time calculation to nanoseconds 2023-10-16 15:38:59 +00:00
Dudemanguy 50025428b1 ao: convert all timing code to nanoseconds
Pull AOs work off of a callback that relies on mpv's internal timer. So
like with the related video changes, convert all of these to nanoseconds
instead. In many cases, the underlying audio API does actually provide
nanosecond resolution as well.
2023-10-16 15:38:59 +00:00
Dudemanguy d310430332 stats: convert timers to nanoseconds 2023-10-16 15:38:59 +00:00
Dudemanguy 5cda1a5deb demux: convert cache updates to nanoseconds
As a bonus, we can remove the awkward and horribly named MP_SECOND_US.
2023-10-16 15:38:59 +00:00
Dudemanguy de9b800879 timer: add convenience time unit conversion macros
There's a lot of wild 1e6, 1000, etc. lying around in the code. A macro
is much easier to read and understand at a glance. Add some helpers for
this. We don't need to convert everything now but there's some simple
things that can be done so they are included in this commit.
2023-10-16 15:38:59 +00:00
Dudemanguy 9d3e607cf7 command: unbreak runtime play-dir changes
The whole mess with setting the option value explictly and saving the
old stop_play value only needs to happen if we're at the end of file.
Doing it in general is unneccessary and breaks other things.
Fixes #12424.
2023-10-16 09:14:20 -05:00
llyyr 056072bf95 stats.lua: remove compatibility aliases of properties
These are ancient and have existed since before stats.lua lived in the
mpv repository. We don't need to worry about ancient mpv versions
anymore, so remove these.
2023-10-15 14:30:09 +00:00
Christoph Heinrich f5d4f2aea4 af_scaletempo2: better defaults
Why a bigger search-interval is required:

scaletempo2 doesn't do a good job when the signal contains frequencies
less then 1/search_interval. With a search interval of 30ms that means
anything below 33.333Hz sounds bad.

Depending on the genre it's very for music to contain frequencies down
to 30Hz, and sometimes even a little bit below that. Therefore a higher
default value is needed to handle such cases.

Based on that an argument can be made for a value of 50, as that should
work down to 20Hz, or something even higher because movies sometimes
have some infrasonic content.

However the downside of big search intervals is increased CPU usage and
intelligibility at higher speeds, as it effectively leads to parts of
the audio being skipped.

A value of 40 can handle frequencies down to 25Hz, enough for all music
except very rare edge cases, while still providing decent
intelligibility.

Why a smaller window-size is required:

Large values reduce intelligibility at high speeds and therefore small
values are preferred.

However when values get too small it starts to sound weird
(similar to librubberband).

In my testing a value of 10 already works well, but adding a small
safety margin seems like a good idea, especially since it made no
noticeable difference to intelligibility, which is why 12 was chosen.
2023-10-15 13:39:59 +00:00
Christoph Heinrich 4a88e3d5c0 stats.lua: fix page 2 alignment of "Total"
The text didn't line up with with the percentages above it because it
didn't use a monospace font.

Instead insert the text at the same position in the template as the
percentages and convert one o.prefix_sep from the percentages into hard
coded \h\h to ensure alignment even when the user changes o.prefix_sep.
2023-10-15 13:39:46 +00:00
der richter 78d43740f5 vo_gpu/vo_gpu_next: add vulkan support for macOS
add support for vulkan through metal and a translation layer like
MoltenVK. also add the possibility to use different render timing modes
for testing.

i still consider this experimental atm.
2023-10-14 18:39:56 +02:00
der richter bc66de2834 mac: add a window animation lock to wait for animations to finish
add an animation lock to the window to prevent the window from closing
while animating. if this is done while the fs animation is running the
dock will stay hidden. this is not used yet, because it's unnecessary
for cocoa-cb but will be for new vo backends.
2023-10-14 18:39:56 +02:00
Kacper Michajłow fd46070490 hwdec_dxva2egl: fix log value type
Fixes type mismatch after recent changes.

Fixes: 59dd7d94af
2023-10-14 14:02:54 +00:00
Kacper Michajłow 991f834e9e stats.lua: add chroma-location 2023-10-14 12:30:46 +02:00
Kacper Michajłow 28ecbcd36b stats.lua: change "Pixel Format" to "Format" 2023-10-14 12:30:46 +02:00
Kacper Michajłow 81cf697e28 stats.lua: fix missing newline when print_perfdata_passes is enabled 2023-10-14 12:30:46 +02:00
Kacper Michajłow 73db283296 stats.lua: sort filter parameters to ensure consistent output 2023-10-14 12:30:46 +02:00
Kacper Michajłow 9dddfc4fcc player/command: change how floating point number are printed
Use "%.7g" to show 7 significant digits. Removes the trailing zeros, and
in general makes it more readable, than fixed 3 decimal digits.

For avsync use "%+.2g" to add plus sign, similar to display-sync
values.
2023-10-14 12:30:46 +02:00
Kacper Michajłow 52fc378494 stats.lua: don't print custom pixel format, when hwdec
There is already other place to indicate hw decoding. "cuda" or "d3d11"
is not a pixel format.
2023-10-14 12:30:46 +02:00
Kacper Michajłow e5446399e1 stats.lua: remove leading zeros from pass timings
Makes it more readable in my opinion.
2023-10-14 12:30:46 +02:00
Kacper Michajłow 31ba5cd6df stats.lua: add frame info 2023-10-14 12:30:46 +02:00
Kacper Michajłow 6ff165f4a4 stats.lua: simplify fps display
- rename prefix to `Framerate:`
- if both estimated and specified values are the same display fps once
- skip the suffix if both the estimated and specified values agrees
2023-10-14 12:30:46 +02:00
Kacper Michajłow c4b8ddeee3 stats.lua: adjust spacing between values a little 2023-10-14 12:30:46 +02:00
Kacper Michajłow 499a9d90ab stats.lua: show HDR meta if not equal to 203
SDR white (203) is indeed not interesting, but anything else, even if
lower is.
2023-10-14 12:30:46 +02:00
Kacper Michajłow f2f33ac1e8 stats.lua: separate video parameters from video out
Source video parameters are interesting, but we mix them with video
output/target parameters. Which will differ. Add "Display" showing
true output params from VO, including HDR passthrough info and
everything. This makes much more consistent output and alows to quickly
diagnose how is source video translated to target display.
2023-10-14 12:30:46 +02:00
Kacper Michajłow 72536cce62 f_decoder_wrapper: change video-codec to show description or name
Not both of them. Formating it as `<name> (<desc>)` produced arguably
silly string like `hevc (HEVC (High Efficiency Video Coding))`. Unpack
this to show only description if available or name otherwise. Produces
way nicer results in stats.lua and similar places where this name is
printed.
2023-10-14 12:30:46 +02:00
Kacper Michajłow c4f0b24deb command: fix fps property name
fps property was not renamed in events.
2023-10-14 12:30:46 +02:00
Kacper Michajłow eb4031e6db command: early exit in some properties to avoid going through VOCTRL 2023-10-14 12:30:46 +02:00
Kacper Michajłow 4bbe961885 m_property: add read_sub_validate to check if should be processed
In many cases it makes sense to early exit instead of preparing all the
data only to return type or not implemented.
2023-10-14 12:30:46 +02:00
Dudemanguy 273906490d vo_gpu_next: only increment osd_sync in update_overlays if paused
While the video playing, it's not actually needed and can cause
unnecessary redraws. Fixes #12623.
2023-10-13 14:00:22 +00:00
Guido Cella c470934236 command: fix segfault with playlist-{next,prev}-playlist
This was wrongly assuming that playlist_path is always set for the
current playlist entry, but it's only set when a file was added by
expanding a playlist.

The crash in playlist_get_first_in_next_playlist can be reproduced with
mpv foo.mkv foo.zip, playlist-next, playlist-prev,
playlist-next-playlist. You need to run playlist-next, playlist-prev
first because foo.zip's playlist_path is NULL until you do that, which
makes playlist_get_first_in_next_playlist return immediately.

The crash in cmd_playlist_next_prev_playlist can be replicated with mpv
--loop-playlist foo.zip foo.mkv, running playlist-next until foo.mkv,
and playlist-play-next. Again, you need to open foo.zip first or its
playlist_path is NULL which skips running strcmp(entry->playlist_path,
mpctx->playlist->current->playlist_path).

Fixes https://github.com/mpv-player/mpv/issues/12495#issuecomment-1760968608
2023-10-13 13:54:43 +00:00
Guido Cella 6f83a730ba README: update release frequency
Updates README.md like 1e9a2cbebf updated DOCS/release-policy.md.
2023-10-13 12:02:55 +02:00
NRK fa9e1f06ff terminal-unix: make stop/cont sighandlers pipe based
there are currently some silly data-races in the stop/cont sighandler
due to the fact that the signal handler might get invoked in a different
thread.

this changes those sighandlers to a pipe-based approach similar to the
existing "quit" sighandler.
2023-10-13 11:36:01 +02:00
NRK c2d0a4a80f terminal-unix: avoid data race + simplify
tio_orig and tio_orig_set are being touched inside of signal handler
which might be invoked from another thread - which makes this a data
race.

there's no real reason to set tio_orig inside of do_activate_getch2()
which is registered as a signal handler. just set it once, in
terminal_init(), before any signal handlers come in play.

this also allows removing the tio_orig_set variable completely.
2023-10-13 11:36:01 +02:00
NRK 1abe908e31 terminal-unix: avoid data-race on do_deactivate_getch2
do_deactivate_getch2() touches some global variables which *might have*
been fine if the terminal thread was the one that received the signal
but AFAIK which thread will handle the signal is not well defined.

in my case, when quitting mpv with CTRL+C the main thread receives the
signal rather than the terminal thread and touches those globals without
synchronization. caught by ThreadSanitizer.

the solution is to move the do_deactivate_getch2() call outside of the
signal handler.
2023-10-13 11:36:01 +02:00