Commit Graph

695 Commits

Author SHA1 Message Date
nanahi 6f17a5efe3 stats.lua: fix incorrect storage aspect ratio value
The "Resolution" property shows the storage resolution for videos with
non-square pixels.

Currently, display aspect ratio is shown for both "Resolution" and
"Output Resolution" properties which results in a duplicate,
and is incorrect for the "Resolution" property.

The correct aspect ratio is now shown using the sar and sar-name properties.
2023-11-14 15:00:23 +00:00
Christoph Heinrich 5db7dc0860 console: fix crash for long suggestion strings
String formatting of Lua crashes with widths greater then 99, so limit
the value to that.

A nicer solution would be to create our own string padding function that
can handle bigger widths, but such long suggestions aren't common enough
to be worth the effort.
2023-11-11 20:43:02 +00:00
Kacper Michajłow e682834234 stats.lua: disable ASS formatting when printing to terminal 2023-11-08 21:55:08 +00:00
Guido Cella c798f66343 stats.lua: remove unused variable
056072bf95 deleted the only use of property_list.
2023-11-07 20:58:30 +00:00
Guido Cella 5c2cdb749d console.lua: don't print the console log to the OSD when switching VO
Fixes #12735, fixes #12839.
2023-11-07 20:49:44 +00:00
Christoph Heinrich 69c4ed585d stats: don't overwrite color and alpha of `osd-back-color` 2023-11-07 20:48:37 +00:00
Christoph Heinrich 2406a89e00 console: don't overwrite color and alpha of `osd-back-color` 2023-11-07 20:48:37 +00:00
Christoph Heinrich f41805081b console: wrap rows at the top
The previous commit was already a big improvement, but it was still
somewhat slow on the lua interpreter. By wrapping the table at the top
we loose the consistent placement of items while resizing (at least as
long as the column count didn't change), but we avoid taking all the
off screen items into account.

The fewer items fit on screen the faster this becomes.
2023-11-07 01:36:59 +00:00
Christoph Heinrich ff131d7a20 console: optimize table generation
Showing all properties was terribly slow.
Instead of starting at one row and increasing the row count until it
fits, the column count can be increased until it doesn't fit anymore.

That alone already reduces the required iterations, but from the column
count an upper and lower bound for the row count can be calculated.

For large tables this dramatically reduces the amount of iterations.
2023-11-07 01:36:59 +00:00
Christoph Heinrich bca0b20c09 console: enable completions without a prefix
This way it is possible to get a list of all options or all properties,
instead of having to guess the first letter before any suggestions are
shown.
2023-11-07 01:36:59 +00:00
Guido Cella 386de3f275 console.lua: complete raw properties 2023-11-07 00:59:16 +00:00
Christoph Heinrich 43ed0a83d0 console: avoid redundant completion appendage
So far completing something like `${some-pro}` with the cursor between
`o}` would result in `${some-property}}`. Adding that superfluous `}` can
be avoided by checking if it's already in the string after the cursor.
2023-11-07 00:55:15 +00:00
Christoph Heinrich bcbd821fa9 ytdl_hook: fix mixed thumbnail.preference availability 2023-11-06 14:59:05 +00:00
Kacper Michajłow 73fbe09a49 ALL: use pl_hdr_metadata and nuke sig_peak
This commit replaces all uses of sig_peak and maps all HDR metadata.

Form notable changes mixed usage of maxCLL and max_luma is resolved and
not always max_luma is used which makes vo_gpu and vo_gpu_next behave
the same way.
2023-11-05 18:57:36 +01:00
Kacper Michajłow 1174afcccc csputils: add pl_hdr_metadata to mp_colorspace and deprecate sig_peak
Note this commit does not change all uses of sig-peak, this is for
future refactoring.
2023-11-05 18:57:36 +01:00
Dudemanguy fcc67cc6c1 lua: remove a ton of unneeded parentheses
For whatever reason, some of the lua code (particularly the osc and
ytdl_hook) is full of a bunch of stuff like if (foo), if not (foo ==
nil), etc. The parenthesis aren't needed in lua and actually just look
weird since nobody actually writes lua like this. You can see most of
the other conditionals are written normally. So cleanup the style to
match when the parenthesis clearly aren't doing anything. Not directly
related, but also add some spaces on a few math operations while we're
at it.
2023-11-02 16:03:20 +00:00
Guido Cella 56fada1a5e console.lua: complete file paths 2023-11-02 14:58:28 +00:00
Guido Cella 7846a0cc0c console.lua: complete list option verbs 2023-11-02 14:58:28 +00:00
Guido Cella ada89aba83 console.lua: inline mp.options
This avoids a "Redefined local `options`" LSP warning in
list_option_list() after the previous commit. It still works, but
reusing names for local variables is error-prone.
2023-11-02 14:58:28 +00:00
Guido Cella f97593dcee console.lua: complete list options 2023-11-02 14:58:28 +00:00
Guido Cella 8e16dcf2a2 console.lua: complete profiles 2023-11-02 14:58:28 +00:00
Guido Cella e1ca04274d console.lua: complete commands after help
And complete help itself.
2023-11-02 14:58:28 +00:00
Christoph Heinrich b6703873cf console: complete infinite cycle-values arguments
cycle-values already completed the first two arguments, but the command
accepts infinitely many arguments, so enable completion for all of them.
2023-11-01 22:15:48 +00:00
Christoph Heinrich 612faed856 ytdl_hook: reverse thumbnail order
ytdl lists thumbnails in ascending order according to height/preference.
all_formats=yes adds formats from best to worst, so the same should also
be done for thumbnails.
2023-10-30 16:46:17 +00:00
Christoph Heinrich 21609953cc ytdl_hook: support the preference field of thumbnails
yt-dlp has a preference field for it's thumbnails, and not all of it's
listed thumbnails have fields with their dimensions.
Therefore prefere the preference field when available and fall back to
height if it's not.
2023-10-30 16:46:17 +00:00
Christoph Heinrich 045f4a7315 ytdl_hook: add thumbnail option
Opening speed could be improved with the "async" prefix, but then the
tracks would be out of order.
2023-10-30 16:46:17 +00:00
Eva a5b0eceeba ytdl_hook: support thumbnails
Similar to "write-sub=", adding "write-thumbnail=" to raw-options will add the highest resolution thumbnail as a video track.

Closes #7041
2023-10-30 16:46:17 +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
Dudemanguy 1382a854c9 stats.lua: disable tonemapping plot by default
Nobody except a chosen few (I'm not one of them) even knows what it
means. Multiple people thought it was actually some kind of rendering
bug. Just disable it by default. Closes #12671.
2023-10-22 13:34:56 +02:00
Dudemanguy 6e428c261e ytdl_hook: remove extra playlist insert
b388c73540 should have deleted this line
since the insert is done a little below it instead, but it was missed
during review.
2023-10-21 18:29:57 -05:00
Umar Getagazov b388c73540 ytdl_hook: parse the separate cookies field
https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-v8mc-9377-rwjj
https://github.com/yt-dlp/yt-dlp/commit/1ceb657bdd25
2023-10-21 22:30:22 +00:00
Guido Cella 9a40a0977b stats.lua: hide images' FPS
It is useless to show this because it's just a bogus value taken from
--mf-fps.
2023-10-19 13:33:47 -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 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
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 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