Add 4 stage trie to lookup unicode codepoint width and grapheme join
rules.
Generated by GraphemeTableGen from Microsoft Terminal (MIT Licence):
a7e47b711a/src/tools/GraphemeTableGen/Program.cs
With minor adjustment to use it in C codebase.
- Replaced constexpr with static
- Replaced auto with explicit types
Generated from Unicode 16.0.0:
ucd.nounihan.grouped.xml: sha256(b11c2d23673bae660fff8ddcd3c1de4d54bdf6c60188a07696b010282f515fcf)
The CI breaking because some new format was added in the master branch
is pretty annoying so only run these on release versions that are known
to work to reduce some maintenance burden. Although why we even bother
with this is still a valid question.
This test:
- Checks if libmpv can be loaded dynamically.
- Checks for leaks after mpv context destroy.
- Checks if libmpv can be reloads after dlclose()
Helps with testing during cross-compilation and avoids external
dependency.
Output maybe is not that nice, but this output in our tests is not
useful anyway. We know if it changes it is beacuse one of the dependency
version changed.
Paths like foo.mkv, ./foo.mkv .//foo.mkv, ../"$(basename
"$PWD")"/foo.mkv, and C:\foo.mkv and C:/foo.mkv on Windows, use
different config files for resuming playback, so if you quit-watch-later
and later play the same file with a different path, mpv does not resume
playback. This commit normalizes the paths on Unix to fix this.
Removes mp_puts/mp_fputs and adds mp_fwrite.
In fact I wanted fwrite instead of puts, no need to make it more awkward
with the implicit new lines.
Fixes: fc55f355fc
This enhancement makes it easier to create constant width property
expansions, useful for the `--term-status-msg`. Additionally, it changes
to `%f` printing with manual zero trimming, which is easier to control
than `%g`. With this method, we can directly specify precision, not just
significant numbers. This approach also avoids overly high precision for
values less than 1, which is not necessary for a generic floating-point
print function.
A new print helper function is added, which can be used with adjusted
precision for specific cases where a different default is needed. This
also unifies the code slightly.
timeBeginPeriod() only allows setting minimum timer resolution
to 1 ms. However, modern x86 platforms support a minimum timer
resolution of 0.5 ms. Use NtSetTimerResolution() instead for
the increased resolution, which can be set with MPV_HRT_RES.
Additionally, change the units of mp_start_hires_timers(),
mp_end_hires_timer(), MPV_HRT_RES, and MPV_HRT_MAX to nanoseconds,
in accordance with other functions used in timer.h.
GetConsoleMode() can be quite slow and in mpv the mode never changes, so
we can just check it once.
Fixes performance when writing lots of logs to terminal.
The screenshot command is documented to not overwrite existing files.
However, there is a race window between the filename is generated with
gen_fname and when the file is open to write. Specifically, the
convert_image function in this window can be very time consuming
depending on video and screenshot image format and size. This results
in existing file being overwritten because the file writing functions
don't check for the existance of file.
Fix this be opening the file in exclusive mode. Add overwrite parameter to
write_image for other operations that are documented to overwrite existing
files, like screenshot-to-file. Note that for write_avif, checking
existance is used instead because avio_open does not support exclusive
open mode.
These tests should really be rewritten to be less stupid so they don't
break everytime ffmpeg updates its formats, but that's too much effort
right now. Bump the required libavutil version as well.
8e1ef7c38f