Commit Graph

51000 Commits

Author SHA1 Message Date
Kacper Michajłow 4e6325d012 stream_cdda: suppress -Wstrict-prototypes from cdio 2023-10-19 14:03:23 +00:00
Kacper Michajłow 1ea1359a82 win32: suppress pointer cast warning 2023-10-19 14:03:23 +00:00
Kacper Michajłow f0b2854e93 charset_conv: suppress unused-label warning 2023-10-19 14:03:23 +00:00
Kacper Michajłow cb48b40bb3 vo_gpu_next: cast const away to suppress warning 2023-10-19 14:03:23 +00:00
Kacper Michajłow 7e18a46ec2 d3d11: don't skip last char in buffer
Both buffers have the same size (32) and if the source is not null
terminated it should be fixed there. Copy whole buffer.
2023-10-19 14:03:23 +00:00
Kacper Michajłow b9b58f122b ci: enable -Werror
For better feedback on build status and to keep mpv warning free.

Except for macos builds, there are more issue there that need fixing.
2023-10-19 14:03:23 +00:00
Kacper Michajłow 94b7584972 win32: clear background only on first paint
Some users report visible black frames during window resize, this should
not happen in most cases. Let's just keep stale content as it is less
distracting. While still clearing on first window paint to avoid white
background.

Fixes: #12642
2023-10-18 15:22:22 +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
Claude Heiland-Allen 46842da8d5 demux/lavf: move tags instead of copying
Use mp_tags_move_from_av_dictionary() in place of
mp_tags_copy_from_av_dictionary().

This ensures that when lavf appends metadata
that occurs later in the stream,
it starts from empty each time.

Fixes: <https://github.com/mpv-player/mpv/issues/12559>
2023-10-18 16:52:47 +02:00
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