0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00
Commit Graph

52612 Commits

Author SHA1 Message Date
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
nanahi
3840c98b36 editorconfig: punish tab usage
This makes tab width to 7 on GitHub web UI and supported editors, making it
impossible to use tabs to match the existing 4 space indentation.
2024-06-16 01:22:13 +02:00
Guido Cella
eae74bdb7a osc.lua: replace tabs with spaces
Fixes b6d7f778b8.
2024-06-16 01:21:55 +02:00
Kacper Michajłow
9b935c9076 fuzzers/meson: set link language to cpp 2024-06-16 01:21:16 +02:00
Kacper Michajłow
6c908363cd demux_lavf: fix null derefence of stream variable
demux_stream_is_selected() already checks if stream is valid, so move
the image format hack check after that.

Fixes: 4ef7931266
2024-06-15 18:08:16 +02:00
Kacper Michajłow
ab0a50874b d3d11: return minimum bitdepth for display output and swapchain
If the output display reports high bitdepth, 12-bit and 10-bit swapchain
is used the value returned from d3d11_color_depth needs to take it into
account.
2024-06-15 01:18:44 +02:00
nanahi
3fa09458da demux_lavf: add format hack entry for jpeg metadata frames 2024-06-14 17:16:19 +00:00
nanahi
daa3264d3f demux_lavf: fix null derefence in io_open callback
The options parameter here can be NULL. It's NULL checked a few lines down,
but not for the propagate_opts loop. This results in null derefence with
--demuxer-lavf-format=image2.

Fixes: b6413f82b2
2024-06-14 17:16:19 +00:00
Kacper Michajłow
a41cdf0289 stats.lua: align 100% correctly on page 2
It is not common to have one pass with 100% usage, but it is not
impossible, so handle this case too.
2024-06-14 00:26:04 +02:00
Crend King
6031a0e173 vf_vapoursynth: upgrade to VapourSynth API v4
VapourSynth introduced their version 4 API in R55, 3 years ago. mpv is
still using the deprecated version 3. I think it is good to migrate
before VapourSynth completely removes it.

The most impacted area is the video format. Previously we have a fixed
table of supported formats, each represented by an integer. In v4, the
integer is replaced by pointer to the full struct of the format.

Second, the way to create video filter is changed. Previously caller
needs to supply a "initialization" callback to `createFilter()`, which
sets up video info etc. In v4, video info is prepared first, passed to
the `createVideoFilter2()` and we get back the node.

Also, previously mpv was using the `fmSerial` filter mode, which means
VapourSynth 1) can only request one frame from mpv at a time, and 2) the
order of frames requested must be sequential. I propose to change it to
the parallel request mode, which requests multiple frames at a time in
semi random order. The reasons are, for 1), the get frame function,
`infiltGetFrame()`, unlocks the mutex during output image generation,
thus can benefit from parallel requests. For 2) thanks to the frame
buffer, unordered frame requests are acceptable. Just make sure the
buffer is large enough.

Third, the way VapourSynth scripting environment works change. In v4,
the scripting API is operated through struct pointer, much like the
exist `vsapi` pointer. The "finalize" function is also no longer needed.
2024-06-14 00:25:18 +02:00
Dudemanguy
4ef7931266 demux_lavf: drop jpeg frames that are at a nonzero pos
There are jpg files out there that have extra embedded metadata
(pictures from smartphones commonly have an embedded gain map). ffmpeg
doesn't currently support this, so mpv currently sees the extra metadata
as essentially another frame. This results in weird video-like behavior.
Until ffmpeg support this more properly, we can work around this by
simply discarding extra packets and not sending the new frame to the
internal playloop. If demux_lavf detects that the stream is a
single-frame jpg, then we only accepts the packet at pos 0. Anything
else is discarded. Ref #13192.
2024-06-13 19:12:29 +00:00
Dudemanguy
a900d41b1e Revert "demux_lavf: pass jpg filenames to ffmpeg for probing"
Passing jpg filenames to ffmpeg is actually quite bad. This causes all
jpg images (at least in my testing) to be probed as image2 which is
blacklisted in demux_lavf since it's completely broken (see commit
74e62ed2d1 for some details). What happens
in practice is that the lavf demxuer fails and the it opens in the mf
demuxer instead. This is OK for simple viewing, but because that demuxer
is limited, many specific file properities and other things are
completely unavailable which breaks any script that may depend on them
(e.g. width, height, etc.) For the small subset of files that this
commit appeared to "fix" (in reality, it just fell back to the mf
demuxer) is not worth breaking property usage in the vast majority of
normal proper files. Ideally ffmpeg should fix this but some other
workaround on our end can be used instead.

This reverts commit d0aeca5918.
2024-06-13 19:12:29 +00:00
Kacper Michajłow
b4bbc27d9c input: map Num 5 to distinct value when numlock is off
Until now both numlock on and off were mapped to KP5.
2024-06-13 20:42:24 +02:00
Guido Cella
80de88361b input.conf: make Alt+BS reset panscan
It makes sense to reset panscan along with the zoom because it is a kind
of zoom.
2024-06-13 12:57:48 +00:00
Guido Cella
5158a3d779 console.lua: don't enable the console-input input section
https://github.com/rossy/mpv-repl enabled and disabled its keybindings
with input sections (define-section, mp.enable_key_bindings and
mp.disable_key_bindings), but when wm4 merged it in mpv, he changed it
to use mp.add_forced_key_binding and mp.remove_key_binding because he
deprecated input sections, but he forgot to remove the
mp.enable_key_bindings line. Remove it now.
2024-06-09 20:50:03 +02:00
nanahi
22103b8a8f osc.lua: fix timetotal and timems settings 2024-06-09 06:08:10 +02:00
nanahi
d2bd77ada0 stats.lua: display file tags
This adds file tags to display along with the title, including
album/artist etc. for music, and series etc. for some videos.
The list of tags to display is identical to the tags printed to
the terminal and is controlled by the --display-tags option.

To filter out overlength tags (such as long comments and lyrics) and
files with too many tags, add file_tag_max_length and file_tag_max_count
options so that tags longer than this length are not displayed, and only
the first few tags are displayed.

Also makes tags show on page 5 only.
2024-06-09 00:58:48 +02:00
nanahi
65fef73c2b input: don't resolve double clicks on the active mouse section
Normally, key bindings are resolved in the input section stack order.
However, mouse key bindings have a special "active mouse section" feature
(which is a section with MOUSE_MOVE bound and mouse button is down in the
section) which lets the section to be selected instead, with a fallback
to the "default" section. The intention of the feature is for mouse
dragging which should "stick" to the section where the mouse is down.

This causes a problem with scripts which bind mouse double clicks:
since double clicks are triggered on mouse down, it's resolved with the
"active mouse section" feature instead of the section stack order.
If the section which has the double click bound doesn't also have
MOUSE_MOVE bound, the "default" section will be used instead.
If it's already bound there, it will be triggered.

Fix this by not resolving double clicks on the active mouse section, which
is not the intention of the feature.
2024-06-08 23:13:15 +02:00
Guido Cella
948faa5482 lua: don't pass nil as the second argument of mp.get_property_number
This doesn't do anything because nil is already the default value of
unavailable properties.
2024-06-08 23:10:37 +02:00
nanahi
828ffc0c8f DOCS/interface-changes: fix formatting 2024-06-08 23:08:43 +02:00
nanahi
e8905650fe TOOLS/gen-interface-changes.py: sort interface changes by file content
With the previous commit, they're in effect sorted by the types of the
interface changes.

As a lazy measure to sort changes by the breakages they cause, sort the
content reverse alphabetically, which works OK by accident.
2024-06-08 23:08:43 +02:00
nanahi
20bd4483b1 DOCS/contribute.md: require interface change begin with type
This makes interface changes appear sorted with the types of changes,
making it easier for users to find breaking changes among all changes.
2024-06-08 23:08:43 +02:00
Guido Cella
1a5edb1e49 stats.lua: remove print_perfdata_passes
22a8b99 introduced print_perfdata_passes as a stopgap until a dedicated
performance stats page would be implemented. Since it has been
implemented for many years, remove this option, which isn't even
documented, and is likely to make the stats overflow beyond the screen.
2024-06-08 23:07:17 +02:00
Kacper Michajłow
73e779a1ee stats.lua: add page 5 for currently selected tracks information 2024-06-08 23:06:22 +02:00
nanahi
6679ef003e stats.lua: make the append function increment index only on newline
To avoid a large append parameter refactoring is to make the append
function add the table index only if the newline character is not empty.
Otherwise, new strings are appended to the existing string.
2024-06-08 23:06:22 +02:00
Kacper Michajłow
94859997b8 sub: update codec info 2024-06-08 23:06:22 +02:00