Commit Graph

51902 Commits

Author SHA1 Message Date
nanahi 465f405703 osdep/main-fn-win: fix implicit conversion warning 2024-03-19 08:58:18 +01:00
nanahi fbea9607be osdep/threads: fix warning: initializer element is not constant 2024-03-19 08:58:18 +01:00
nanahi e9f966595c ao_lavc: fix warning: ISO C forbids forward references to 'enum' types 2024-03-19 08:58:18 +01:00
nanahi a6f8d1d961 vo_gpu_next: fix -Wembedded-directive warning
warning: embedding a directive within macro arguments has undefined behavior
2024-03-19 08:58:18 +01:00
nanahi 59f23f5c29 video/out/gpu/spirv: fix warning: zero size arrays are an extension 2024-03-19 08:58:18 +01:00
nanahi 18bd03d31a common/msg: fix warning: void function should not return void expression 2024-03-19 08:58:18 +01:00
nanahi 98ab8d87a1 common/msg: fix warning: use of non-standard escape character '\e' 2024-03-19 08:58:18 +01:00
nanahi 302ccf18ef options/m_config: fix no newline at end of file 2024-03-19 08:58:18 +01:00
nanahi 82a186567e various: fix -Wold-style-declaration warning
warning: `static' is not at beginning of declaration
2024-03-19 08:58:18 +01:00
nanahi 4f381f2137 video/out/placebo/utils: fix -Wignored-qualifiers warning
warning: type qualifiers ignored on function return type
2024-03-19 08:58:18 +01:00
nanahi a3489c8a0f demux/cache: fix -Wtype-limits warnings
warning: comparison of unsigned expression >= 0 is always true
warning: comparison is always false due to limited range of data type
2024-03-19 08:58:18 +01:00
nanahi b2c1e55e5d meson: bump warning level to 2
Ignore a few noisy warnings for now.
2024-03-19 08:58:18 +01:00
Kacper Michajłow cbe30f614d vo_gpu_next: don't render ASS subtitles at HDR colorspace
Upstream ASS specification says that all subtitles should be rendered
with color primaries and transfer matching their associated video. But
as expected after further discussion the decision has been made to
fallback to SDR mode in case of HDR video.

See-Also: 649a7c2e1f/libass/ass_types.h (L233-L237)
See-Also: libass/libass#297
See-Also: mpv-player#13381
Fixes: mpv-player#13673
2024-03-18 21:24:06 +01:00
der richter bf1c8acdac mac/touchbar: simplify item and view creation 2024-03-18 20:29:27 +01:00
der richter 9f68214a06 mac/touchbar: optimise time item update 2024-03-18 20:29:27 +01:00
der richter d7cc5cdec1 mac/touchbar: optimise constraint calculation 2024-03-18 20:29:27 +01:00
der richter ef82ef0bb5 mac/touchbar: use DateComponentsFormatter for time formatting 2024-03-18 20:29:27 +01:00
der richter be49f4fe20 mac/touchbar: simplify update items logic 2024-03-18 20:29:27 +01:00
der richter 647bf5d0ba mac/touchbar: take playback speed into account for rate limiting 2024-03-18 20:29:27 +01:00
der richter c8088d801a mac/touchbar: rewrite touch bar in swift 2024-03-18 20:29:27 +01:00
Kacper Michajłow c155c18023 win32: remove all NC area on Windows 10 with --title-bar=no
Windows 10 top bar height cannot be adjusted individually when
WS_CAPTION is enabled due to buggy DWM NC drawing behavior. The issue is
fixed in Windows 11.

To keep consistent window look remove the border on each side, but only
on Windows 10.
2024-03-18 02:22:28 +00:00
Kacper Michajłow e8b085fbb5 win32: add helper function to check Windows 10 build number 2024-03-18 02:22:28 +00:00
Kacper Michajłow ad093567e8 osc: add missing window controls for --title-bar=no 2024-03-18 02:22:28 +00:00
Kacper Michajłow bb15c50658 win32: adjust top border offset when title bar is disabled
Windows 11 draws border regardless, so we are 1px off on window size,
blending border with one line of video. Fix that by adding the border to
our internal windows size calculation.

Windows 10 on the other hand has a bug where specifying left and top NC
area will trigger title bar drawn in full height always. Keep old
behaviour in this case. Also while there is similar "visible" border
there, it seems to be transparent on Windows 10.

For high contrast themes, don't adjust title bar height and instead
remove WS_CAPTION to have the same border all around the window, as DWM
doesn't make borders invisible in this case.
2024-03-18 02:22:28 +00:00
Kacper Michajłow 1764d772ad win32: add DWMWA_VISIBLE_FRAME_BORDER_THICKNESS definition 2024-03-18 02:22:28 +00:00
Kacper Michajłow 3045f1458d win32: use dpi aware GetSystemMetricsForDpi 2024-03-18 02:22:28 +00:00
nanahi ee586c526d win32: update maximized state when leaving fullscreen
If the window-maximized is set while in fullscreen, it needs to be applied
when leaving fullscreen, as noted in the comment.
2024-03-18 01:58:53 +00:00
nanahi 2be8976d59 win32: fix window maximized state after setting window size
With runtime geometry change, currently it only results in a
SetWindowPos call to resize the window. However, SetWindowPos doesn't
change the window maximized state, so Windows still thinks that the
window is maximized even though it no longer covers the whole workspace.
This results in visual glitches, and if the window is dragged afterwards
it's "restored" again.

Fix this by correctly setting the window maximized state in this case.
2024-03-18 01:58:53 +00:00
sfan5 ead9f892b3 various: use static assertions where appropriate 2024-03-17 20:04:04 +01:00
Guido Cella 23c988b3e1 DOCS/options: --x11-name sets the instance name, not the class's 2024-03-17 15:04:30 +00:00
Dudemanguy ccafd40ccc demux: add a format-name property
It can be useful to know the underlying format of any entry in the
track list. Only applicable to the lavf demuxer.
2024-03-17 14:59:40 +00:00
nanahi 8a9749b8a5 wayland_common: respect compositor's preferenced size on state change
Currently mpv always uses the previous window size when unmaximizing
or exiting fullscreen. This disregards compositor's preferenced size in
the configure event, resulting in wrong window size if changing window
state and size are delivered in the same configure event.

It's better to always respect the preferenced size instead, unless
the state change is due to runtime geometry change, where we want
to use our preference.
2024-03-17 14:59:26 +00:00
nanahi b2ce96bd35 DOCS/options: clarify --autofit-larger effect
Clarify that --autofit-larger sets the maximum size of the window.
The original wording was not written with runtime change in mind,
so the implication of "not changing size" is ambiguous.
2024-03-17 14:59:26 +00:00
nanahi ea33d52a4a wayland_common: always use the current geometry for prepare_resize
In the xdg_toplevel_configure handler, in some cases the geometry is
not equal to the width and height in the event. This can happen
when runtime geometry change is requested (a new size is set),
or in the case of wl->state_change || width == 0 || height == 0
(the old size is used).

However, prepare_resize always uses the width and height in the event
and not the corrected geometry here. This causes
xdg_surface_set_window_geometry using the wrong value resulting in
wrong size of window decoration. Amusingly, the debug message right
above it uses the correct size.

Fix this by using the updated geometry size instead. Since now all
prepare_resize have parameters of 0, the width and height parameters
are no longer needed.

Fixes: 828dd65ef8
2024-03-17 14:59:26 +00:00
nanahi 25ae54dd84 x11_common: unmaximize window on runtime geometry change
8e793bde78 made that changing geometry
while maximized has no effect until the window is unmaximazed. However,
this behavior is inconsistent with setting window-scale on all of win32,
wayland, and x11, which always unmaximizes the window and sets the
window size.

Since setting geometry is conceptually similar to setting window-scale
(both change the window size), they should have the same behavior.
If not fullscreen, unmaximize window on runtime geometry change to
keep the behavior consistent with window-scale.
2024-03-17 14:59:26 +00:00
nanahi 4370dc0cb6 win32: support runtime geometry update
Similar to other platforms. Also make sure that the x/y positions are set
on geometry update.
2024-03-17 14:59:26 +00:00
nanahi f236e249a4 x11_common: fix window x/y position when updating geometry on runtime
Currently, setting geometry on runtime only changes the window size
but not the position. This is because reset_size is only set if
the window size is changed, and vo_x11_highlevel_resize doesn't set
the window position without force_window_position enabled. Fix this
by setting the related flags and perform a window move when
geometry is updated.

Fixes 8e793bde78.
2024-03-17 14:59:26 +00:00
Kacper Michajłow 83da97f955 github/issue_template: add note about --profile=fast and --hwdec 2024-03-17 14:59:08 +00:00
Kacper Michajłow 7265bde26a gpu-next: add support for --dither-depth=auto
On supported APIs.
Fixes: https://github.com/mpv-player/mpv/issues/11862
2024-03-17 14:28:00 +01:00
Kacper Michajłow 16e3d7dca6 d3d11: get real on the wire bits per color channel 2024-03-17 14:28:00 +01:00
Kacper Michajłow 2b0c7b1aa4 d3d11: add mp_get_dxgi_output_desc 2024-03-17 14:28:00 +01:00
der richter 3afcaeb71a mac/view: optimise drag and drop event handling 2024-03-16 15:29:27 +01:00
der richter 2a36ed9abd mac/input: optimise scroll wheel event handling 2024-03-16 15:29:27 +01:00
der richter a4eddf742d mac/input: move scroll wheel event handling into input helper 2024-03-16 15:29:27 +01:00
der richter 9a4c673dd7 mac/input: optimise mouse movement enabled check 2024-03-16 15:29:27 +01:00
der richter 53722a4082 mac/input: fix switched mouse forward and back button 2024-03-16 15:29:27 +01:00
der richter db4eac140d mac/input: move mouse event handling into input helper 2024-03-16 15:29:27 +01:00
Vilius ab419a6660 ao_coreaudio: stop audio unit after idle timeout
Commit 39f7f83 changed ao_driver.reset to use AudioUnitReset instead of
AudioOutputUnitStop. The problem with calling AudioOutputUnitStop was
that AudioOutputUnitStart takes a significant amount of time after a
stop when a wireless audio device is being used. This resulted in
lagging that was noticeable to users during seeking and short
pause/resume cycles. Switching to AudioUnitReset eliminated this
lagging.

However with the switch to AudioUnitReset the macOS daemon coreaudiod
continued to consume CPU time and did not release a powerd assertion
that it created on behalf of mpv, preventing macOS from sleeping.

This commit will change ao_coreaudio.reset to call AudioOutputUnitStop
after a delay if playback has not resumed. This preserves the faster
restart of playback for seeking and short pause/resume cycles and avoids
preventing sleep and needless CPU consumption.

Fixes #11617

The code changes were authored by @orion1vi and @lhc70000.

Co-authored-by: Collider LI <lhc199652@gmail.com>
2024-03-16 15:00:46 +01:00
bptato 801306acdf stream: enable caching for sockets, pipes and FIFOs
This is useful e.g. when the caller dup2's a socket into stdin, or
passes a socket/pipe as /dev/fd/{fd}, because it is impossible to seek
on sockets and pipes.
2024-03-16 13:41:24 +01:00
sfan5 830f6ccd6b vo_{drm,wlshm}: make query_format checks more correct
We're using mp_sws here, so we should ask it for format support
and not the underlying library (usually swscale) directly.
2024-03-16 13:27:34 +01:00