205 Commits

Author SHA1 Message Date
Kacper Michajłow e6887ed972 test/libmpv_common: add temp_path() and wait_event() 2026-10-14 18:09:16 +02:00
Kacper Michajłow 33b2093b32 test: add aes-ctr stream test 2026-10-14 18:09:16 +02:00
Kacper Michajłow e9961b6014 test: add SDH filter tests for events with a null byte
ffmpeg cannot write a null byte from a text subtitle, so the muxed
samples get one patched in.
2026-10-14 02:22:05 +02:00
Kacper Michajłow fe4c604069 test/swresample: check by speaker and check more of it
The expected output was written down per case, and all channel orders
among the cases were their own inverse, so an inverted channel map
passed. The reference is now what libswresample mixes between the
speakers of both maps, applied by speaker, and itself checked against
a few values written down by hand. The options of libswresample that
change the mix are set as well.
2026-09-27 22:02:43 +02:00
Kacper Michajłow a1bf4b6559 test: add swresample channel conversion test 2026-09-26 17:41:34 +02:00
Kacper Michajłow ccfe4871db test/avio_crypto: add test for stream decryption 2026-06-27 19:04:03 +02:00
llyyr 3d4893a893 test/language: replace accidental octal literal
Surrounding code uses decimal 0, not octal 0, so probably a typo
2026-06-12 19:15:18 +02:00
nanahi 1d82932cce various: use fopen wrapper for cloexec handling 2026-06-04 04:58:16 +02:00
Kacper Michajłow 333857403f test/libmpv_common: wait for all clients and player to be destroyed
mpv_destroy() only detaches the client, while leaving the player alone.
Since this is exit cleanup, we should just wait and quit whole player.
2026-05-03 20:26:40 +02:00
Kacper Michajłow dc59f3b399 test/libmpv_test_track_selection: add test for program mappings 2026-05-01 11:41:31 +02:00
Kacper Michajłow bf1a14e541 test/libmpv_common: print property in checks 2026-05-01 11:41:31 +02:00
Kacper Michajłow 0c067f140e test/libmpv_test_track_selection: add test for --flatten-editions 2026-05-01 10:42:00 +02:00
Hubert Głuchowski 7ec11ad67a misc/codepoint_width: handle partially ill-formed UTF-8
Previously the function just bailed on invalid input, this instead makes
it count how many replacement characters would be shown by a terminal
complying with the Unicode specification's recommendation here:
https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G66453

Fixes https://github.com/mpv-player/mpv/pull/17773#issuecomment-4277538534
2026-04-22 00:06:59 +02:00
Kacper Michajłow 6c165fe46e demux_lavf: add support for programs
This adds proper support for MPEG-TS programs and HLS variants. Now
program selection is exposed as editions and tracks are grouped under
such edition. If there are external tracks added, they are available in
all editions.
2026-04-17 18:30:43 +02:00
Kacper Michajłow 18330cb1ed video/img_format: add repack test for new formats 2026-02-19 19:18:56 +01:00
Kacper Michajłow 54976fe147 video/img_format: add IMGFMT definitions for x2bgr10 and rgba16f
Will be useful for mapping hardware frames. We could add more formats
here, but those should be enough to allow RGB processing.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 7b015a9846 video/img_format: remove custom rgb30 definition
It's supported in ffmpeg since 4.4, no need to keep custom code for it.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2b4b345a3a video/img_format: rename IMGFMT_RGB30 to IMGFMT_X2RGB10
It's supported in ffmpeg, so let's have naming parity.
2026-02-19 19:18:56 +01:00
sfan5 60dd40d007 test/img_format: remove dead code 2026-02-08 11:51:26 +01:00
sfan5 e01165d3db test/repack: test draw_bmp at some uneven sizes
intended to discover bugs like f3c1dcf7a1
2026-02-08 11:51:26 +01:00
sfan5 272404533e test: add reference files for ffmpeg 8 2026-02-08 11:51:26 +01:00
Filip Hejsek 7298ce13b0 test/samples: use mpeg2 codec for video samples
In CI, ffmpeg chooses vp9 by default, which cannot be muxed into mpegts.
2026-01-24 07:54:46 +01:00
Filip Hejsek c2882c3d81 player/loadfile: never autoselect tracks with wrong PID
Currently, we prefer selecting a track that matches the video program
ID, but can fall back on a track with a different program ID when there
is no such track or when no such track matches subs-fallback criteria.

Change this to instead select no track when only tracks with wrong PID
are available. Program ID will now act as a filter, not as a preference,
and only files with either matching or unset PID will be considered for
autoselect.

Also, ignore the program ID of external tracks, as it doesn't make much
sense to compare PIDs from different files.
2026-01-24 07:54:46 +01:00
Filip Hejsek 3e12e6fcff test/libmpv_test_track_selection: add a program ID matching test 2026-01-24 07:54:46 +01:00
Filip Hejsek bdbe40765a test/libmpv_test_track_selection: add a more complex locale test
The purpose of this test is mostly to verify that matching the OS
language is not wrongly prioritized over other things (like the forced
flag, matching the audio language, etc).
2026-01-24 07:54:46 +01:00
Filip Hejsek 79e87fa62d test/libmpv_test_track_selection: add a locale test with forced tracks
This is a copy of the existing locale test, but with forced flag added
to all tracks. The forced flag should not affect language selection in
this case.
2026-01-24 07:54:46 +01:00
Filip Hejsek 8aca078f09 test/libmpv_test_track_selection: add additional multilang test case
The new test case exercises --subs-fallback-forced=always and verifies
that default+forced is preferred over forced.
2026-01-24 07:54:46 +01:00
Kacper Michajłow f4db102a2e osdep/language-win: remove use of GetSystemPreferredUILanguages
The system preferred language is the language used during Windows
install. It doesn't have much purpose except that it is the backend
language for core Windows internals. All user facing dialogs and text
should follow the user preferred language, as this is what the user
selected and uses on daily basis.

It makes no sense to include system language in track selection.
2026-01-21 04:39:54 +01:00
Kacper Michajłow 4338880560 various: add MP prefix for {PRINTF,SCANF}_ATTRIBUTE 2025-10-05 21:34:29 +02:00
Dudemanguy 9b4e8fcb07 test/libmpv_common: fflush stdout and stderr in fail 2025-10-02 15:15:48 +00:00
Dudemanguy 3bbb94077d test/libmpv: use common wrappers for properties and commands
This is mainly for better, more descriptive logging when something goes
wrong and fails. Common operations that manipulate properties and
commands go through shared functions that do better detailed logging.
Also it means we don't need check_api_error around anymore so get rid of
that. libmpv_lifetime is left untouched since that one is a bit special
and works a little differently.
2025-10-02 15:15:48 +00:00
Dudemanguy e0cf3f8061 test/libmpv_encode: use libmpv_common.h
De-duplicates some code.
2025-10-02 15:15:48 +00:00
Dudemanguy 74b47cfcb4 test/libmpv_test_sdh_filter: start test paused and at 1 second
There is some race condition where MPV_EVENT_PROPERTY_CHANGE sometimes
gives us sub-text with an empty string which is unwanted and causes the
test to fail. Avoid this by starting the file at 1 second and paused
which hopefully avoids this. Do some additional checking on the actual
MPV_EVENT_PROPERTY_CHANGE as well to make sure we don't try to read
something we shouldn't.
2025-09-25 16:49:40 +00:00
Dudemanguy a664eede96 Revert "test: always build path_source and options/path.c for test_utils"
No longer needed.

This reverts commit afbd3abb20.
2025-08-08 01:07:00 +00:00
Dudemanguy 5b2bcc55db test: add some tests for the sub_sdh_filter 2025-08-06 13:57:38 +00:00
Dudemanguy cc7f9e3ce8 test/libmpv: inline some test-specific helpers in libmpv_common
These functions could be useful for any libmpv test and in fact
check_string was already duplicated in a couple of places. Inline them
in libmpv_common.
2025-08-06 13:57:38 +00:00
Louis Pate 86e12929aa various: fix Wpedantic warnings 2025-08-01 11:56:38 +02:00
Louis Pate 1e64262f1f test: fix Woverflow by using uint8_t array 2025-07-26 20:13:28 +02:00
Dudemanguy afbd3abb20 test: always build path_source and options/path.c for test_utils
Because the previous commit started using mp_get_user_path in core
m_option files, various tests failed with undefined references due to
these two files not being included. Add them to the common list of
test_utils files.
2025-07-22 17:52:41 +00:00
dyphire 2d149e007f misc/language: parse default tag from external subtitle tracks 2025-07-06 12:52:22 +02:00
Dudemanguy 494afa4115 test/libmpv_test_track_selection: add a test for regional languages
Relevant for the forced subtitle case where we want a regional audio
language like en-US to match eng language subtitles. The general
matching logic is covered in the language test already.
2025-06-19 20:18:02 +00:00
Kacper Michajłow cce45aa054 test/libmpv_test_track_selection: fix locale check
The size of the buffer was never set so the Get*PreferredUILanguages()
were just returning ERROR_INSUFFICIENT_BUFFER.

Fix the buffer size and use the returned count as sanity limit.

Fixes the test.
2025-04-01 21:27:45 +02:00
Kacper Michajłow 06a983ef2f test/libmpv_test_track_selection: fix compilation with Windows SDK 2025-04-01 21:27:45 +02:00
Tom Grimwood-Taylor f608780032 misc/language: parse forced tag from external subtitle tracks
Fixes: mpv-player#16060
2025-03-31 11:47:52 +02:00
Kacper Michajłow 74d3c2f0e7 mp_image: set repr.alpha and repr.bits when mapping AVFrame
Fixes invalid colors with gpu-next direct mapping of some formats.
2025-03-26 18:39:40 +01:00
Kacper Michajłow 7df3f442ea misc/language: parse hi/sdh/cc tags from external subtitle tracks
This also adds `hearing-impaired` argument to `sub-add` command.

Fixes: #14805
2025-03-08 00:21:06 +01:00
Kacper Michajłow 450535ba1e tests: use mp_require to allow tests to be run with NDEBUG 2025-03-04 20:07:29 +01:00
Kacper Michajłow 1c49cfdb97 various: use mp_assert macro 2025-03-04 20:07:29 +01:00
Kacper Michajłow f1e1a0be85 include: move public headers to own directory
This ensures a clear separation between public and private headers. It
also makes it clear in Meson and prevents the accidental use of private
headers.
2025-02-23 01:40:12 +01:00
Kacper Michajłow d759e26fd0 libmpv: use correct header directory name
libmpv headers are installed to `mpv/`, so why are we pretending it is
`libmpv`?

Fixes documentation, libmpv meson dependency, tests.
2025-02-23 01:40:12 +01:00