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

52373 Commits

Author SHA1 Message Date
Guido Cella
b086a404b5 command: return lavfi filters in option-info/[av]f/choices
This adds non-mpv filters to option-info/af/choices and
option-info/vf/choices, which allows completing them with set af/vf
<Tab> in console.lua.

Partial fix of #13017. Getting the filter options would required adding
af-list and vf-list properties.
2024-05-05 14:43:57 +02:00
Kacper Michajłow
eab9737ea6 osc: remove trailing space
Fixes: b80e4e46a3
2024-05-05 14:38:18 +02:00
Kacper Michajłow
22ed5d0d3a demux_mkv: fix image detection
If blocks were already demuxed we would skip them and ask for new ones.
For files with few blocks it would return EOF without actually checking
the content.

Also make demux limit higher. In practice it doesn't matter, because if
it is image, video track will have only 1 block. And if it is not image
it will break on 2nd video block.

Fixes: #13975
2024-05-05 14:28:02 +02:00
Aman Karmani
abe8f3f9df demux: keep track of ts information per stream type
Signed-off-by: Aman Karmani <aman@tmm1.net>
2024-05-05 14:11:47 +02:00
Kacper Michajłow
4cc9e6f999 win32: fix maximize state with --border=no
WS_POPUP windows cannot be maximized, so instead of forcing it with
unavoidable side-effects, change the window style before maximizing to
make it work correctly.
2024-05-05 14:02:57 +02:00
Guido Cella
646f31f196 sd_ass: don't log if subtitles have unknown duration
Users shouldn't have to care if subtitles' duration is unknown because
the only difference is that decode() sets a duration to packets without
one, if any.

The main difference was code intentionally breaking sub-seek, sub-step,
sub-start and sub-end for unknown duration subtitles for some reason,
but I removed it in 0f2370476b and 185fa9ffc6.

LRC subtitles always have unknown duration so if you use them having
this logged on every song is annoying, so only log it in verbose mode.
2024-05-05 13:59:41 +02:00
Kacper Michajłow
d347ee0e91 ci/lint: use long commit hash
No reason to use short hash in script internally.
2024-05-05 13:54:07 +02:00
Kacper Michajłow
e42e0f2e2a demux_mkv: make V_QUICKTIME codec detection generic
This allows playing files with any fourcc that is supported by mpv.
2024-05-05 13:53:43 +02:00
Matthias Hunstock
2414051d76 osd: show left arrow when playing backwards
If playback direction is backwards, display a triangle
pointing to the left as status symbol of OSD.
2024-05-05 13:47:20 +02:00
Matthias Hunstock
5631d83b5f tools: add narrow left arrow glyph for OSD
Add rotated arrow glyph on unused codepoint U+E00D.
2024-05-05 13:47:20 +02:00
Matthias Hunstock
b80e4e46a3 osc: show left arrow when paused while playing backwards
Use existing glyph for playlist buttons to show a triangle
pointing left if playback is stopped with a backward playback
direction.
2024-05-05 13:47:20 +02:00
sfan5
c4b6d0da38 f_lavfi: reject filters with too many in/outs
The pad count serves as a minimum even if the filter has
dynamic inputs/outputs, so we should reject them here.

At least on FFmpeg 6.1 this results in no practical change
in the list accepted filters.

fixes: 8bf3fe7e2a
2024-05-04 16:13:03 +02:00
Kacper Michajłow
637bc6994f f_decoder_wrapper: clear decoder info on deinit
It is not longer valid and may cause use-after-free if used after
decoder itself is destroyed.

Fixes: #14051
2024-05-04 11:20:38 +02:00
sfan5
943a50b300 ci/mingw: update dependency versions 2024-05-03 23:44:51 +02:00
omar
a26bbbd78d OSC: implemented user configurable colors 2024-05-03 16:50:49 +02:00
nanahi
861908c70f win32: make context menu items accessible from the window menu
This makes the context menu items accessible from the window menu,
which can be opened by either right-clicking on the title bar or
left-clicking on the mpv icon on the title bar.
2024-05-03 16:36:02 +02:00
nanahi
ee2e14015d win32: move context menu init/uninit to GUI thread
Currently if VO init fails, the context menu is leaked. Additionally,
init/uninit are in the VO thread, while other accesses are in the GUI
thread.

Fix this by moving them to the GUI thread, similar to other resources.
This also lets init function take the mpv HWND in the next commit.
2024-05-03 16:36:02 +02:00
Dudemanguy
cb613ba916 wayland: set wl->scaling if there is no wl->current_output yet
If we get either preferred_scale or preferred_buffer_scale this early
during initialization the wl->scaling value should be immediately
updated instead of being deferred until later for correct geometry.
Fixes #14019.
2024-05-03 16:18:35 +02:00
nanahi
dec73f503f sub/osd: fix rounding when rescaling bitmap subtitle rects
With multiple rects touching each other without any gaps, the current
scale method can cause gaps or overlaps between rects. To make sure that
this does not happen, scale on the edges of the rects instead, and then
calculate the width and height from the results.

NB: while this is better than the status quo, it does not fix all
scaling artifacts because of the following:

- When two rects share a vertical edge but have different heights,
  misalignment will occur: after rounding rect heights to pixels,
  the height scale factor for the two rects will be slightly different.
  As a result, there will be misalignment between the scaled images.
- With a GPU renderer, different bitmap subtitle parts are rendered as
  different textures. This means that the pixel contents of the parts have
  different boundary conditions from the whole combined image. As a result,
  there will still be small gaps when the subtitle is scaled up.

The only way to properly address these points is to make sure that the
parts are combined to a single image at the native resolution before
being scaled. This can be partly achieved with --blend-subtitles=video.
2024-05-03 16:16:53 +02:00
nanahi
e20ca15b66 win32: support multitouch
Use the multitouch API. To disable system's defualt mouse emulation,
set --native-touch=yes.
2024-05-03 16:14:03 +02:00
nanahi
807a6d875a options: add --native-touch option
For platforms which send emulated mouse inputs for touch-unaware clients,
such as Win32 and X11, this option enables the native multitouch handling
and disables emulated mouse inputs. This enables interested scripts to
handle multitouch events while keeping compatibility with touch-unaware
scripts.
2024-05-03 16:14:03 +02:00
nanahi
f0e163bab5 wayland_common: support multitouch
Use the multitouch API. No need to emulate mouse input as it's already
done by the input system.
2024-05-03 16:14:03 +02:00
nanahi
89aa10de24 input: add MP_TOUCH_RELEASE_ALL
Release all touch points. Used by some VOs like Wayland touch cancel
event.
2024-05-03 16:14:03 +02:00
nanahi
77809faea1 input: add --input-touch-emulate-mouse option
This adds --input-touch-emulate-mouse option, which controls whether to
enable legacy touch handling where touch inputs are emulated as mouse
inputs. This establishes a primary touch point (the one with the lowest
index) as the emulated mouse position, and MBTN_LEFT up/down with the
appearance of the first touch point and the disappearance of the last
touch point.

This fixes some problems with touch handling on Wayland, for example
attempting to pinch results in a double click.
2024-05-03 16:14:03 +02:00
nanahi
46cca1a67f command: add touch-pos property
This adds touch-pos property, which contains the information of all
current touch points. The property has sub properties:

touch-pos/count: the number of current touch points
touch-pos/N/x,y: the position of touch point N
touch-pos/N/id: unique identifier of the touch point
2024-05-03 16:14:03 +02:00
nanahi
28a4fb8e4e input: add multitouch support functions
The goal of multitouch support is to interpret as little as possible:
mpv just stores the touch point information and makes the position
available for query. Does not participate in the deprecated input section
system.

The API is modeled after the common part of the touch input APIs of
Win32, X11, and Wayland, to make sure the platform-specific implementations
are as simple as possible.
2024-05-03 16:14:03 +02:00
nanahi
91bb2f2543 sd_lavc: reduce unnecessary error log on probing nonexistent codecs 2024-05-03 16:13:07 +02:00
nanahi
fc741dab1a sd_lavc: fix null dereference on error
If sub decoder does not exist, priv remains NULL.

Fixes: 1394e5a111
2024-05-03 16:13:07 +02:00
Dudemanguy
d61d294665 wayland: log if cursor shape support is missing
This is done for the other protocol interfaces already but was
accidentally omitted.
2024-05-02 13:46:20 +02:00
Sebastian Ramacher
ec447fd4a2 DOCS: fix spelling of environment and corresponding/corresponds 2024-05-01 14:39:52 +02:00
Kacper Michajłow
b68c742b27 demux/packet: add support for ITU T.35 metadata in Matroska 2024-04-29 01:37:02 +02:00
MartinEesmaa
4f828676fd demux: support VVC Matroska demux
This allows to demux Versatile Video Codec with Matroska container to play.
2024-04-29 01:35:31 +02:00
der richter
4a686dac6f mac: properly handle regular expressions without force unwrap 2024-04-28 20:21:18 +02:00
der richter
8f1189341f mac: code cleanup and consistency changes, fix linting issues 2024-04-28 20:21:18 +02:00
der richter
984c890661 mac/helper: make wakeup callback declaration consistent 2024-04-28 20:21:18 +02:00
der richter
6df06e5dc5 mac/touchbar: use KVO block API instead of old obj-c instance method 2024-04-28 20:21:18 +02:00
Kacper Michajłow
69d70148c7 TOOLS/lua/autoload: make ignore_patterns more generic 2024-04-27 03:14:31 +02:00
oficsu
3ca71b0c0e TOOLS/lua/autoload: allow multiple ignore_patterns 2024-04-27 03:14:31 +02:00
oficsu
96b34148f1 TOOLS/lua/autoload: add ignore_pattern option
Autoload script can now exclude certain files

Why? Sometimes you want to ignore thumbnails,
auto-generated backups or just unwanted files

A non-exhaustive list of real-world examples:
- user backup files: '%.bak%.mp4$' or '^bak-'
- telegram-desktop thumbnails: '_thumb%.jpg$'
- a krita graphics editor backup suffix: '^~'

See documentation here: lua.org/pil/20.2.html
2024-04-27 03:14:31 +02:00
nanahi
93708a9d38 w32_common: fix show-in-taskbar toggling after explorer is restarted
After explorer is restarted while show-in-taskbar is false, toggling
show-in-taskbar no longer puts mpv back to the taskbar until it's
unfocused and refocused.

My guess of how this works is that the HWND of the taskbar is cached,
and setting the WS_EX_TOOLWINDOW style internally uses this value to
show/hide the taskbar button. But after explorer is restarted it no
longer works until its taskbar state needs to change (such as focusing).
Only then it realizes the HWND is no longer valid and refreshes it.

Fix this by following MS documentation on this: the window needs to be
hidden before changing the style, and be shown after that. This
unfortunately can sometimes introduce a brief window flash, but it
fixes the problem.
2024-04-27 03:02:00 +02:00
Guido Cella
2f4c550b4b zsh-completion: complete --gpu-context
This is made by possible by 96e1f1dfa5 standardizing --gpu-context's
help output. This changes the check to complete any Object settings list
so it will automatically work with future options of this kind.
2024-04-27 03:01:06 +02:00
Kacper Michajłow
fbfc9d22c7 ci: add fuzzers build test 2024-04-27 02:47:47 +02:00
Kacper Michajłow
47dbc3a74e fuzzers: add new fuzzer targets
fuzzer_set_property.c:

fuzz mpv_set_property in both initialized and non-initialized state.
Useful for user provided values sanitization test. I've already seen
some memory leaks in parsing code, good to drill it.

fuzzer_loadfile.c:

mpv_command "loadfile" test. Good for testing demuxers, decoding and
playback loop. Sadly in headless mode we can't really test AO and VO,
but at least all the code around can be fuzzed. Especially our custom
demuxers like demux_mkv.

fuzzer_loadfile_direct.c:

Similar to loadfile above, but instead of saving the data to file, it
passes the fuzz input in the command. Generated protocol specific
versions (mf:// and memory:// for now) and generic one.

Nothing really complex, but good start and even those few targets should
give good coverage of the most common code paths in libmpv.
2024-04-27 02:47:47 +02:00
Kacper Michajłow
0b234af113 player/command: mark sub-text-ass as deprecated
Fixes: 437fff9f21
2024-04-27 01:23:52 +02:00
rcombs
99f1b2b7b4 player/command: add sub-text/ass-full sub-property
This is like sub-text/ass, but it returns a full ASS line, making it suitable for some more advanced scripting use-cases.
2024-04-27 01:19:56 +02:00
rcombs
437fff9f21 player/command: move sub-text-ass to a sub-property 2024-04-27 01:19:56 +02:00
rcombs
aa0a9ce2ec sd_ass: allow get_text to return more than 500 bytes 2024-04-27 01:19:56 +02:00
Kacper Michajłow
e3fd24496a stats.lua: show osd-dimensions property
This change displays the scaled position and size of the image before
cropping to the target rectangle. In simple terms, it shows how much
margin has been added to the image or how much of the image has been
cropped.

Note that target resolution is displayed after crop as in fact all other
pixels are discarded anyway.
2024-04-27 01:15:25 +02:00
Kacper Michajłow
f55d19e846 sub/lavc_conv: don't override style of converted teletext pages
This fixes teletext pages rendering, while keeping the same default
style for subtitles and other converted formats.
2024-04-27 01:14:23 +02:00
Kacper Michajłow
d8378dc226 sub/lavc_conv: don't strip ASS style header
This fixes converted subtitles that are styled.

This reverts commit 5e2c211a4e.

Most of the subtitle decoders in libavcodec sets meaningful style
values. For the rest we can conditionally strip style.
2024-04-27 01:14:23 +02:00