Commit Graph

132 Commits

Author SHA1 Message Date
Kacper Michajłow 3c5a79300c various: remove av channel layout check 2024-06-22 16:12:14 +02:00
Dudemanguy 42a4c306ec test/libmpv_test: fix some stray tabs 2024-06-19 23:04:21 -05:00
Dudemanguy b402cc3248 test/libmpv_encode: avoid mktemp warning
Doesn't really matter but it's annoying so replace it with mkstemp
instead. For windows, just use _mktemp.
2024-06-19 13:55:54 +00:00
Kacper Michajłow 0c716e762f test/meson: remove unneded sources 2024-06-03 19:18:06 +02:00
Kacper Michajłow 4caca3e6c0 test/paths: skip normalize tests if pathcch library is not available
If pathcch is not available paths are not normalized on Windows.

Fixes tests on ancient mingw.
2024-06-03 19:18:06 +02:00
Kacper Michajłow 734846c123 test_utils: don't use subprocess for diffing test results
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.
2024-06-03 19:18:06 +02:00
Kacper Michajłow 09c359e1d3 test/libmpv_encode: print logs also during initialize 2024-06-03 19:18:06 +02:00
Kacper Michajłow 8a9901963d test/libmpv_encode: don't use mpv internals for test
mktemp is good enough for this test purposes and also tests if libmpv is
able to create a file that doesn't exist.
2024-06-03 19:18:06 +02:00
Guido Cella 1f69659a77 test: test mp_guess_lang_from_filename with [] and () 2024-05-10 22:54:12 +02:00
Guido Cella 63d820bd68 test: test mp_guess_lang_from_filename() 2024-05-10 01:22:31 +02:00
Kacper Michajłow 5009e13431 player/loadfile: match language and subcodes 2024-05-09 17:12:55 +02:00
nanahi f11002cef3 various: fix tabs in code 2024-05-07 11:23:08 +02:00
Kacper Michajłow 006c3ce9fe test: mark libmpv as expected fail if OSC is not available
This test is expected to fail without lua and osc.lua support.
2024-05-06 22:01:17 +02:00
Kacper Michajłow cd12e923f8 test/libmpv_encode: minor adjustments for win32 build fix 2024-05-06 22:01:17 +02:00
Kacper Michajłow 5cf0da2a6a various: remove unused sys/time.h include 2024-05-06 22:01:17 +02:00
Kacper Michajłow 053d971507 misc/path_utils: normalize win32 paths 2024-05-05 19:37:57 +02:00
Guido Cella 1d640c9887 player: normalize paths for resuming playback
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.
2024-05-05 19:37:57 +02:00
Guido Cella 1128989885 test: fflush between printf and abort
This is necessary to show the output with meson test. Followup to
06edb04692.
2024-05-05 17:51:34 +02:00
sfan5 426be8441a test: make libmpv_test abort if an error is logged
Among others this provides a trivial test that built-in scripts aren't throwing
an error at load or init time.
2024-04-24 12:58:50 +02:00
sfan5 3b64bf908a test: add an encoding test with libmpv 2024-04-17 20:22:36 +02:00
Dudemanguy a5269d7a73 test: support format refs for multiple ffmpeg versions
With some small tweaks to the test, we can support multiple ffmpeg
versions. This adds back ffmpeg 6 support that was removed in the
previous commit.
2024-04-12 17:39:34 +00:00
Dudemanguy 05607fed19 test: update format refs for new major ffmpeg version
xvmc was removed and d3d12 was added.

a12cd3be98
142f727b9c
2024-04-12 17:39:34 +00:00
Kacper Michajłow c389f9e75e win32: change fputs to fwrite wrapper
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
2024-04-07 20:23:04 +02:00
Kacper Michajłow 06edb04692 test: fflush output stream before abort
For `meson test` to not eat lines on abort.
2024-03-21 03:50:11 +01:00
Kacper Michajłow 8708f4dc91 m_property: add `>` for fixed precision floating-point expansion
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.
2024-03-21 03:50:11 +01:00
nanahi 8c1117b2cb meson: remove winmm dependency for win32 desktop target
Not needed anymore as timeBeginPeriod() is removed.
2024-03-19 20:23:25 +01:00
nanahi aff376e066 win32: increase hires timer resolution
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.
2024-03-19 20:23:25 +01:00
Kacper Michajłow fc55f355fc win32: add puts/fputs wrappers 2024-03-19 19:58:09 +01:00
Kacper Michajłow 3372e17d51 win32: optimize mp_vfprintf a little
- remove redundant strlen/wcslen
- reuse allocated temporary buffers

The difference is not big, but it satisfies me to remove those
redundancies.
2024-03-19 19:58:09 +01:00
Kacper Michajłow 8ee25db71f win32: cache GetConsoleMode state for stdout/stderr
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.
2024-03-19 19:58:09 +01:00
nanahi 9a861c930b image_writer: fix TOCTOU in screenshot filename generation
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.
2024-03-19 19:30:27 +01:00
Dudemanguy b08822b8ce test/test_utils: add mp_msg_set_max_level stub
Needed since the previous commit.
2024-03-03 15:15:51 -06:00
der richter f9b8f156d7 test: add missing libplacebo dependency 2024-02-24 20:04:16 +01:00
nanahi 4e73602ae5 options/path: move path utility functions to misc/path_utils
These utility functions have nothing to do with user and config dir/file.
Move them to a separate file.
2024-02-23 21:35:57 +01:00
Kacper Michajłow 19a6b84915 osdep/timer: update documentation and test for mp_time_ns
No longer true after 8bbcc87fee.
2024-01-26 03:28:55 +00:00
Kacper Michajłow 66e451f4e6 csputils: replace mp_colorspace with pl_color_space 2024-01-22 14:54:55 +00:00
nanahi 7ffd947830 win32: move IME candidate window to video window
By default the IME candidate window appears on the top left corner
of the monitor. Move it to the video window for sane behavior.
2024-01-15 16:06:06 +00:00
Dudemanguy cf27152991 test: update ffmpeg format refs
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
2023-11-18 20:46:11 +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 71e888c2a0 timer: remove unused code 2023-11-05 17:36:17 +00:00
Kacper Michajłow f75fe33da7 threads: rename threads.c to threads-posix.c 2023-11-05 17:36:17 +00:00
Kacper Michajłow 56d35da180 mp_thread: add win32 implementation 2023-11-05 17:36:17 +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 2f5f15039d test/meson: add missing libplacebo dep 2023-10-24 01:30:22 +00:00
sfan5 dad4e61b68 test: add basic tests for timer code 2023-10-20 21:30:51 +02: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
Kacper Michajłow d263087713 meson: don't link pthreads when internal impl is used 2023-09-29 20:48:58 +00:00
Kacper Michajłow d0e4eabb4e meson: add missing gl-video test dependency 2023-09-29 20:48:58 +00:00
Kacper Michajłow 40e0fea6eb timer: rename mp_add_timeout to reflect what it actually does 2023-09-29 20:48:58 +00:00
Kacper Michajłow da4c4d2ebd timer: rename mp_time_us_to_timespec to reflect what it actually does 2023-09-29 20:48:58 +00:00