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

51840 Commits

Author SHA1 Message Date
der richter
fe35baa88e mac/menu: rewrite menu bar in swift 2024-03-07 01:03:52 +01:00
der richter
bbbd6e272c mac/app: remove unused function 2024-03-07 01:03:52 +01:00
Dudemanguy
4179d58389 github/workflows: generate html and pdf in docs job as well
Not sure if this is particularly useful, but we might as well generate
these as well. Also use the docutils wrapper since that's what the meson
build does.
2024-03-06 22:49:07 +00:00
savoury1
f532f3f38f DOCS/man/input.rst: fix incorrect syntax
Some incorrect syntax is used in DOCS/man/input.rst with c678033c1d
causing failure of PDF manual generation with rst2pdf. There are single
rather than double back-ticks for insert-at and insert-at-play so this
is fixed and a couple of typos are also corrected with this commit.
2024-03-06 22:34:05 +00:00
der richter
68c61fd89f mac/vulkan: directly retrieve current render size without caching
the render size cached in ctx->vo->dwidth/dheight can be outdated in
some circumstances at the time the context needs resizing. instead use
the current render size.
2024-03-06 23:37:32 +02:00
der richter
6016423427 mac/vulkan: workaround for MoltenVK problem that causes flicker
MoltenVK itself tries to work around a supposedly Metal problem that
itself causes flicker, black screens or broken rendering. it sets the
drawableSize to 1x1 to forcefully complete the presentation. though if
1x1 resolution frame is presented it causes a visual flicker or rather
a solid coloured frame. it causes even more problems since sometimes it
does not reset the drawableSize to the proper resolution and keeps
rendering everything in 1x1.

work around this workaround by discarding drawableSize that are <=1 in
any direction.

Fixes #13505
2024-03-06 23:37:32 +02:00
Kacper Michajłow
665a472098 github/workflows: update actions/upload-artifact to v4 2024-03-05 19:48:14 +01:00
Dudemanguy
83bad548d2 ad_spdif: handle deprecated FF_PROFILE_* definitions
See: 8238bc0b5e
2024-03-05 19:04:11 +01:00
nanahi
9c03b7569b wayland_common: fix pointer serial conflict
c2129c18f8 saves the button down serial to
pointer_serial of the seat so that it can be used for window dragging
later. However, this overwrites the serial saved at the enter event.
Since the serial in wl_pointer_set_cursor must be the latest
wl_pointer_enter serial number sent to the client, if a button down
serial overwrites that, setting cursor no longer works until the cursor
enters the window next time.

Fix this by using separate serials for these two types of events.
2024-03-05 17:35:04 +01:00
1nsane000
03bfd797f6 video/filter: add field order support for built in deinterlacers
refqueue gets the field of the frame from mp_image which almost always(if not
always) assumes bottom field order first. By default this behavior should not
change but specifying the field order should bypass this.
2024-03-04 17:41:40 -08:00
1nsane000
5b52d44972 f_auto_filters: pass field parity to lavfi bwdif deinterlacers
Since all of them(software, vulkan, cuda) already have a built in parity
parameter
2024-03-04 17:41:40 -08:00
1nsane000
38a8e9bcba options: add --deinterlace-field-parity option
Previously there was no way to specify the field order of interlaced videos
when deinterlacing with inbuilt filters. Lavfi deinterlacers seemed to prefer
top field order while inbuilt ones (vdpaupp, vavpp, d3d11vpp) seemed to prefer
bottom field order. The default "auto" option should work exactly as before
while specifying either "tff" or "bff" should force the specified field order
2024-03-04 17:41:40 -08:00
Dudemanguy
c1029aaa82 wayland: fix missing lround in cursor surface
Missed in f0a6578259.
2024-03-04 22:42:46 +01:00
Dudemanguy
781f78fb3a wayland: guess the first hidpi frame better
It's been a longstanding issue in wayland* that the first frame on a
hidpi screen will have wrong scaling. A well behaved client immediately
corrects this, but it's noticeable and also can affect window placement
due to the way resizng works. Preferred scale from the fractional
protocol and preferred buffer scale can actually solve this problem. It
depends on compositors mostly, but one could simply send the event
before the client maps its surface so it knows what the correct scale is
in the first place. I'm not sure if any compositors currently behave
like this (sway seems to still require the client to render before
sending any scaling information at least), but it makes to sense to
account for this possibility.

*: https://gitlab.freedesktop.org/wayland/wayland/-/issues/133
2024-03-04 22:42:46 +01:00
Dudemanguy
9ac791c329 Revert "player: reset av state on speed changes"
Ended up being too flawed and caused trouble in other areas. There's
other approaches to trying to solve the issue this meant to address in
the works that should be better, so let's wait on that. Fixes #13613 and
fixes #13622.

This reverts commit e3af545421.
2024-03-03 16:27:59 -06:00
Dudemanguy
d10cebec13 player/video: subtract frame_time from delay when ao_chain starts audio
This seems more robust than relying on the audio status to actually be
playing. For files where there is no audio or the audio start is
delayed, this guards against that but it allows the subtraction to
always occur otherwise on normal files with audio.
2024-03-03 16:24:28 -06:00
Dudemanguy
60abbb424b player/audio: also adjust apts by audio speed in audio_start_ao
Fixes 7051e94e4b
2024-03-03 16:24:17 -06: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
nanahi
385031ae2d ci/mingw: update dependency versions 2024-03-03 16:43:02 +01:00
nanahi
7d31db9e45 ci/mingw: add dav1d decoder
ffmpeg has built-in decoders for almost all common formats, except AV1.
dav1d allows the CI build to play AV1 videos without a hwdec-capable GPU.
2024-03-03 16:43:02 +01:00
nanahi
a81212836d ci/mingw: enable nvdec
Install the nv-codec-headers to enable nvdec for ffmpeg.
This allows the CI build to enable hwdec on opengl and vulkan contexts.
2024-03-03 16:43:02 +01:00
Dudemanguy
1a649afbad demux_lavf: always find stream info for avif files
avif files will commonly be probed as "mov,mp4,m4a,3gp,3g2,mj2" by
ffmpeg, but demux_lavf currently has some logic to skip
avformat_find_stream_info for these kinds of files. It was introduced in
6f8c953042. Presumably, the optimization
of mentioned in that commit is still valid however for avif we
specifically need to do the avformat_find_stream_info call. Without it,
several codec proprieties like width, height, etc. are unavailable. So
just check the extension type and disable the skipinfo optimization.
2024-03-02 16:32:11 +00:00
Kacper Michajłow
9325ebe817 vo_gpu_next: render subtitles at video colorspace 2024-03-02 15:57:02 +00:00
Kacper Michajłow
d6981a4cac sub: add flag if sub_bitmap should be rendered in video color space 2024-03-02 15:57:02 +00:00
psykose
c8f1c822dc DOCS/options: fix Vulkan typo 2024-03-02 12:55:49 +01:00
Kacper Michajłow
9189e8982a vo_gpu: add missing PL_COLOR_TRC_ST428 case in lcms 2024-03-01 18:11:43 +00:00
nanahi
34055919f5 wayland_common: toplevel resize fixes
Explicitly send an UP event after the client finishes a resize for
touch event, don't resize if locked_size is set for touch event,
and use the correct type for resize edges.
2024-03-01 18:25:12 +01:00
nanahi
fb02626cd9 w32_common: make dragging asynchronous
VOCTRLs are processed in the GUI thread through the mp_dispatch mechanism.
Window dragging requests are asynchronous on x11 and wayland, so the item
is processed quickly without problem. However, currently win32 uses the
SendMessage call for this, which is synchronous. This causes the playback
to stop while the dragging request is being processed because the
dispatch queue is blocked.

Work around this by setting a flag instead if the window dragging is
requested, and immediately starts dragging after processing the dispatch
queue. This doesn't block the dispatch queue while also avoiding any
extra latency added by the Windows message queue.
2024-03-01 18:25:12 +01:00
nanahi
4b8c47d20b w32_common: re-add fullscreen check when start dragging
5736737750 removed the check because it was
not needed to prevent fullscreen window from being dragged. However, this
causes an undesirable behavior: when using a touch screen to drag a window
on Windows 11, DWM shrinks the window content a bit with an acrylic
backdrop to indicate that the window is being dragged. This also happens
when trying to drag the window in fullscreen. Add the check to prevent
this from happening.
2024-03-01 18:25:12 +01:00
nanahi
092f556898 input: centralize VO dragging
Currently, VO dragging logic is hardcoded into each VO, where a left mouse
button down event unconditionally begins dragging if the VO dragging test
passes. This method is extremely unflexible as the VO has no knowledge of
what is happening in the input system: while begin dragging with the second
click of a doubleclick is undesired, it cannot determine whether a click
is a double click or not because it's determined by the input system.

The better way to do it is to handle it somewhere in the downstream
consumers of the events instead, as they have more information to make
this decision. The input system is the perfect place for this as the logic
for checking doubleclick already exists. So just issue a begin-vo-dragging
command if it detects a left mouse button down which isn't also a
doubleclick in this case, and delete all hardcoded VO dragging logic
in win32, x11, and wayland.

Note that this solution hardcodes left mouse button down for now, but
because the VO dragging is now centralized, it's possible to make more
improvements, such as a deadzone mechanism to fix the conflict with
MBTN_LEFT mouse bind.
2024-03-01 18:25:12 +01:00
nanahi
c2129c18f8 wayland_common: implement VOCTRL_BEGIN_DRAGGING
This allows begin-vo-dragging command to initialize a vo dragging request
for wayland. The last mouse button press seat and serial is used for the
request if it is not consumed by interactive resizing.
2024-03-01 18:25:12 +01:00
nanahi
14c5da6f50 w32_common: implement VOCTRL_BEGIN_DRAGGING
This allows begin-vo-dragging command to initialize a vo dragging request
for win32. Also set dragging to release all keys like for other platforms.
The hard-coded left mouse button down trigger is scheduled to be removed
in a later commit.
2024-03-01 18:25:12 +01:00
nanahi
6eedf9b1e9 x11_common: implement VOCTRL_BEGIN_DRAGGING
This allows begin-vo-dragging command to initialize a vo dragging request
for x11. The last mouse button press event is used for _NET_WM_MOVERESIZE.
The hard-coded left mouse button down trigger is scheduled to be removed
in a later commit.
2024-03-01 18:25:12 +01:00
nanahi
9d03b83a6c command: add begin-vo-dragging command
This command initializes a vo dragging request for VOs that implement
the new VOCTRL_BEGIN_DRAGGING voctrl. This allows scripts to begin vo
dragging for any button press event.
2024-03-01 18:25:12 +01:00
Dudemanguy
4560d93bf0 Revert "player: add ao-volume option, to set the system volume at startup"
Ended up being a bad idea. As a property, this inherently has more
functionality and the tradeoff of being able to do --ao-volume wasn't
worth it.

This reverts commit 58ed620c06.
2024-03-01 09:20:15 -06:00
Dudemanguy
8ba6d8f7a9 sd_ass: fix use-after-free in ft->event_format
0b35b4c917 originally introduced sd_filter
to make a more general subtitle filter infrastructure. But when doing
so, it directly sets ft->event_format to ass_track->event_format in the
struct. The lifetime of ass_track and the sd_filter are not equivalent
which makes it easy to trigger undefined behavior. Notably, commit
cda8f1613f introduced assobjects_destroy
which can destroy ass_track anytime during runtime which means that the
string in ft->event_format is actually freed and should never be used.
Remedy this by simply doing a proper strdup when the filter inits with
ft as the parent so we avoid this scenario altogether. Fixex #13525.
2024-02-29 15:57:58 -06:00
sfan5
dafced8a8a wayland_common: fix type of dnd_action
The default value of -1 and comparisons >= 0 only work properly
with an int type.
2024-02-29 17:24:05 +01:00
sfan5
878b76f75e wayland_common: fix initialization order issue with protocols
This broke DND under (apparently) GNOME and KWin, but not sway.

fixes: 2274311b25
2024-02-29 17:24:05 +01:00
sfan5
78cedac844 wayland_common: fix DND read error handling 2024-02-29 17:24:05 +01:00
sfan5
dec29e82ac wayland_common: read DND data in larger chunks 2024-02-29 17:24:05 +01:00
sfan5
98f7f9e25e wayland_common: log if DND fails
This can happen if the compositor or applications don't behave correctly,
so let the user know to aid debugging.
2024-02-29 17:24:05 +01:00
sfan5
f36ab2c609 wayland_common: free DND resources on shutdown and error
This leaked only in edge cases, if at all.
2024-02-29 17:24:05 +01:00
der richter
15c48f3dc1 cocoa-cb: render on main queue instead of dedicated queue
initially we drew on a dedicated render queue to circumvent certain
bottlenecks on the main queue, like concurrent events that could lead
to late drawing.

though due to the way cocoa works we need to draw an the main queue
otherwise we get undefined behaviour that could lead to crashes.

Fixes #10276
2024-02-29 16:40:52 +01:00
der richter
7758f6f50e mac/vulkan: set NSView as layer delegate like recommended by MoltenVK 2024-02-29 16:38:10 +01:00
der richter
9b301a0537 osxbundle: fix bundling when homebrew is not installed
Fixes #13603
2024-02-29 16:37:21 +01:00
der richter
be6c22f93b mac/vulkan: remove old deprecated VK_MVK_macos_surface extension remains 2024-02-29 14:06:14 +01:00
Kacper Michajłow
0897604298 various: avoid function pointer casts
The opt validator functions are casted to generic validator, which has
erased type for value. Calling function by pointer of different
definition is an UB.

Avoid that by generating wrapper function that does proper argument type
conversion and calls validator function. Type erased functions have
mangled type in the name.

Fixes UBSAN failures on Clang 17, which enabled fsanitize=function by
default.
2024-02-28 16:04:02 +00:00
sfan5
d955dfab29 misc/jni: reduce duplication in mapping struct
'name' was in fact unused when reading fields or methods, so it can be merged with 'method'.
Also changed the type of 'mandatory' to bool.
2024-02-28 16:11:54 +01:00
sfan5
5b1eaf3ff1 misc/jni: introduce macros for deleting references 2024-02-28 16:11:54 +01:00
sfan5
75ae44472b misc/jni: general code cleanup and refactor
Make it align with mpv's coding conventions in general and avoid unecessary Lavu use.
2024-02-28 16:11:54 +01:00