1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00
Commit Graph

52637 Commits

Author SHA1 Message Date
Guido Cella
f7c1461053 DOCS/input: document undocumented track-list sub-properties 2024-06-24 12:52:36 +00:00
Dudemanguy
26029cfbb0 m_option: add a way for aliases to use sub option prefix
Previously, using m_option_type_alias required that the alias have the
full name of the option value. This is limited if you are reusing the
same opts struct in different sub options. Fix this by add an additional
field to m_option to signal whether or not prefixes should be taken into
account for the alias option. Instead of blindly using whatever is
stored in opt->priv as the name, we can construct the desired option
name for either case (using the prefix or not).
2024-06-24 12:51:28 +00:00
Kacper Michajłow
1225bcbd41 fuzzer_set_property: don't run mpv if set property failed
We can avoid testing this cases, hopefully there are no side-effects
when set property fails.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
a5f2816278 fuzzer_load_{config_file,input_conf}: take into account file size limit
We are strict about load command errors, so we have to clamp the size.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
103cae2591 m_option: ignore excessive elements only for obj_settings_list
It makes sense to allow the first part of the list. There are
warnings about excessive elements already. This also allows overriding
elements with the same label.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
5b3b2273db player/command: limit user-data name splits to 100
It fixes stack-overflow with keys that contains hundreds of splits. 100
is more than enough for any valid use of user-data, normally key
shouldn't contain more than a few splits.

Found by OSS-Fuzz.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
2b056c89cd m_config_frontend: disallow profile=default in config files
profile=default in config file causes infinite recursion. It triggers
reload of the default config, which contains the profile=default...
2024-06-24 03:05:09 +02:00
Kacper Michajłow
a949e0c2d5 misc/random: set constant seed for fuzzing
Fuzzing expect deterministic behavior. While we don't use this random
generator for anything significant, still good to set the seed, in case
of future usage.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
799137a87c fuzzers: disallow include command in more principal way
We should never allow include command for fuzzers and it can be
triggered also by direct set property.
2024-06-24 03:05:09 +02:00
Kacper Michajłow
cd1b63f628 ad_{lavc,spdif}: initialize channel layout
It is not always available for the demuxer, so update it from decoder.
2024-06-23 05:09:13 +02:00
nanahi
f7ed8c42d2 options: add secondary-{sid,sub-delay} to watch_later_options 2024-06-23 05:05:22 +02:00
Kacper Michajłow
c3de4f04db fuzzer_load: disallow include option in config files
It produces undeterministic results, especially if it do
`include=fd://N` which starts loading external data.
2024-06-23 02:33:04 +02:00
Kacper Michajłow
b4123826e5 input/keycodes: validate parsed value to avoid overflow 2024-06-23 02:33:04 +02:00
Kacper Michajłow
7fda885747 m_option: do float multiplication to avoid integer overflow
Huge values doesn't make much sense, but to avoid some arbitrary limits,
use double, as the output is already floating point value.

Found by OSS-Fuzz.
2024-06-23 02:33:04 +02:00
Kacper Michajłow
5534e0e1d9 common: validate parsed unicode codepoints value
Fixes UB when converting out of expected range values.

Found by OSS-Fuzz.
2024-06-23 02:33:04 +02:00
Kacper Michajłow
758019bf92 m_options: fix obj settings list leak on error
Fixes: b3b542af51
2024-06-23 02:33:04 +02:00
nanahi
265056fa54 vo_gpu: optimize pass_info_reset
No need to reset mp_pass_perf which is only read when desc.len > 0.
This avoids zeroing >16384 uint64_t's every time it's called.
Profiling shows that this reduces CPU usage for frame rendering by ~4%.
2024-06-22 22:48:40 +02:00
nanahi
940854c86f demux: allow refresh seek for non-video streams
Since d41f0a54b0, enabling a stream will
no longer perform a refresh seek, to fix issues with switching video
tracks. Additionally, 62e9a0c5f6 also
prevents refresh seek on track switching when it happens right after a
seek.

Unfortunately, when external audio files are loaded, preventing refresh
seeks can cause A-V sync issues. Since external tracks have separate demuxer
instances from the internal tracks, the demuxer instances from both
internal and external tracks are explicitly sought to the same pts when
seeking is performed. When enabling an external audio track for the first
time, the existing logic prevents refresh seek because no packets have ever
been read, so the track ends up not being sought. This means that switching
the track in the middle of playback results in a huge A-V desync.

To make it worse, unlike one demuxer instance with multiple tracks,
tracks from multiple demuxer instances are not synced in any meaningful
way beyond the separate explicit seeking. The only thing which keeps these
tracks synced is the generic A-V sync logic, which is unfit for such large
desync above. This means the audio is at the start position after the track
is switched, behind the video, so the audio is not considered ready, and
audio is continuously filtered sequentially until it is synced to the video.
While this is happening, the audio filtering exhausts all CPU resources.

There is also a case with cache enabled: if a seek causes some new data to
be cached, the demuxer is sought to the end of joined cache range.
If track is switched after this, the existing logic prevents a refresh seek,
so the demuxer is at a wrong position after the track is switched.

Fix this by allowing refresh seek for non-video streams, even when no packets
have been read yet or immediately after a seek.
2024-06-22 18:21:28 +00:00
Kacper Michajłow
e5d85704a3 av_log: sort library version print and add missing libavdevice
Incidentally sorted list put more important libs to the top.
2024-06-22 16:12:14 +02:00
Kacper Michajłow
9e1271260f ad_spdif: fix lavf version check
Fixes: 62b1bad755
2024-06-22 16:12:14 +02:00
Kacper Michajłow
687eb4c875 various: remove no longer needed availability checks
image_writer: remove jpegxl availability check

meson: remove check for lavu vulkan support

image_writer: remove avif availability check

ad_spdif: remove no longer needed definitions

demux_lavf: remove side data extraction compatibility code

demux/packet: remove ITU T.35 availability check

filters/f_lavfi: remove avfilter_filter_pad_count availability check

image_writer: remove PNG cICP support check

mp_image: remove AV_FRAME_DATA_DOVI_METADATA availability check

mp_image: remove AV_FRAME_FLAG_INTERLACED availability check

vd_lavc: remove ctx->pic->duration availability check

sws_utils: remove av_chroma_location_enum_to_pos availability check

vd_lavc: remove AV_CODEC_EXPORT_DATA_FILM_GRAIN availability check

demux_lavf: always use io_close2
2024-06-22 16:12:14 +02:00
Kacper Michajłow
0d8f74231f misc/uuid: remove no longer needed vendored implementation 2024-06-22 16:12:14 +02:00
Kacper Michajłow
3c5a79300c various: remove av channel layout check 2024-06-22 16:12:14 +02:00
Kacper Michajłow
b64521ae10 ci/openbsd: bump to 7.5 and remove libplacebo subproject
The available version is enough now.
2024-06-22 16:12:14 +02:00
Kacper Michajłow
2887b2e64c meson: increase FFmpeg minimum required version to 6.1 2024-06-22 16:12:14 +02:00
Guido Cella
8873beabc3 select.lua: consider --sub-delay for the subtitle line selector
Preselect and seek to the correct subtitle line when there is a
sub-delay.

Also slightly increase the offset without a video track else it
occasionally doesn't seek to the selected line with non-0 sub-delay and
no video. This now uses the same offset as sub/sd.h.
2024-06-22 13:42:27 +00:00
Guido Cella
e3f496dbf5 select.lua: don't use sub-start to preselect subtitle lines
There is no need to compare sub-start now that we don't check for exact
matches with ffmpeg's timestamps. time-pos can always be used.

Comparing time-pos removes the need for the workaround of sub-start of
embedded subtitles being earlier than ffmpeg's timestamps, as time-pos
is always slightly after sub-start.

Removing this workaround also fixes a bug present since 4059d1832b,
which started comparing numerical values of timestamps instead of
strings to determine the preselected subtitle line, where the line after
the current one is preselected when sub-start is greater than ffmpeg's
timestamps because they have been rounded, e.g. sub-start 10.001 is >
than ffmpeg's 10.00.

This will also allow considering --sub-delay in the comparisons, as
comparing sub-start - sub-delay would preselect the wrong lines.
2024-06-22 13:42:27 +00:00
Kacper Michajłow
4ec060f946 vo_tct: clear backbuffer on reconfig
We were drawing garbage data after reconfig, if there is no video
frame ready or with --force-window without video track.

Found by OSS-Fuzz.
2024-06-22 00:50:38 +02:00
Dudemanguy
23ecfa9845 options: remove deprecated auto choice for --mute
Since 995c47da9a, setting --mute=auto has
been equivalent to --mute=no. It was formally documented later in
79e20ff485. This is an old legacy relic
and the auto choice popping up during auto completion could be confusing
to users who aren't aware of the history. Remove it for good and convert
the option to a proper boolean.
2024-06-21 21:29:33 +02:00
Dudemanguy
bab9b2cf4e player/command: alias playback-time to time-pos
Since 7fc4bac29f, playback-time and
time-pos will now always have exactly the same values. Both properties
are commonly used, so just make playback-time an alias for
time-pos and document it.
2024-06-20 13:07:41 +00:00
Dudemanguy
42a4c306ec test/libmpv_test: fix some stray tabs 2024-06-19 23:04:21 -05:00
Dudemanguy
157566904f ao_pipewire: fix some stray tabs 2024-06-19 23:04:05 -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
nanahi
8df4cb5e21 osc.lua: don't use legacy argument for seeking
Deprecated since mpv 0.9. Use the flags instead.
No need to specify flags for relative seek since it's the default.
2024-06-19 01:30:18 +00:00
der richter
bc5ab97d9a ao_avfoundation: guard features only available on macOS 11.3 and 12
build time and runtime checks.
2024-06-18 19:30:07 +02:00
der richter
55241da4ad cocoa-cb: guard color spaces that are only available on 10.15.4 upwards 2024-06-18 19:30:07 +02:00
der richter
e3a290b618 mac/compat: fix broken CGColorSpace declaration on SDK 11 only
seems like apple missed those two colour spaces and didn't add a obj-c
to swift redeclaration of the CFStringRef kCGColorSpace* global
variables.
2024-06-18 19:30:07 +02:00
der richter
0f9630f28d mac/event: remove swift 5.6 language feature that is mandatory with 6.0
this can be tested with -enable-upcoming-feature ExistentialAny
2024-06-18 19:30:07 +02:00
der richter
1364c80e64 mac/compat: add withLock fallback for xcode older than 14
withLock is available for macOS versions starting from 10.10 but can
only be used on xcode 14+. xcode 14 introduced swift 5.7, so we guard it
behind a swift version check.
2024-06-18 19:30:07 +02:00
der richter
b390ade709 mac/log: properly guard logger usage behind platform version check 2024-06-18 19:30:07 +02:00
Diederik de Haas
1acb49f9c6 bash-completion: remove hashbang
Hashbangs are meant for scripts that are executed, but a bash completion
script is meant to be sourced and therefor shouldn't have a hashbang.

Remarked by Debian's ``lintian`` tool with the
``bash-completion-with-hashbang`` tag.
2024-06-18 16:06:02 +00:00
Kacper Michajłow
8e7d442f08 fuzzers: enable edl, file and lavf protocols
To close already fixes issues on OSS-Fuzz.

Hopefully there is enough space for those. There is no way of checking
that, except that it stops working.
2024-06-18 03:11:14 +02:00
Kacper Michajłow
b3b542af51 m_options: limit list entries to 100
Limit list entries to 100. obj_settings_list is not designed to hold
more items, and it quickly starts taking ages to add all items. 100 is
more than enough.

Fixes 30s timeout on OSS-Fuzz and generally fixes possible DoS on mpv.
2024-06-18 03:11:14 +02:00
Kacper Michajłow
783150722d m_options: fix mark_del leak on error
Found by OSS-Fuzz.
2024-06-18 03:11:14 +02:00
Kacper Michajłow
ee2be6dc82 fuzzer_set_property: force untimed and pause state
We don't want to accidentally set those options and timeout in pause
state.

Remove video-osd as there is no reason to set it in fact.
2024-06-18 03:11:14 +02:00
Kacper Michajłow
c194f2dc32 demux_edl: fix infinite loop on empty EDL files
"file" is implicit key, it is always available, so we have to check if
it is not empty.

Found by OSS-Fuzz.

Fixes: 96ef62161a
2024-06-18 03:11:14 +02:00
Kacper Michajłow
71d3f4157b fuzzers: disable some targets as we hit out of space errors
To test if this resolves issues with oss-fuzz.
2024-06-16 05:42:34 +02:00
Crend King
c9ea2798a4 osc.lua: add script message to show up the OSC
Add a way to briefly show the OSC, which is useful to check file name,
playback progress and time left, etc.

Fix issue #3826
2024-06-16 01:23:38 +02:00
Kacper Michajłow
df6b16c0ca stream: don't exit on first iteration if there is no match
Fixes: f921b64ed7
2024-06-16 01:22:30 +02:00
Kacper Michajłow
3b3604e162 ad_spdif: add an assert for lavf_ctx
To suppress forward null warning.
2024-06-16 01:22:30 +02:00