Commit Graph

51235 Commits

Author SHA1 Message Date
Kacper Michajłow 438ead7a3d osdep/w32_keyboard: remove duplicated MP_KEY_BACK mapping
MP_MBTN_BACK is already mapped, the appcmd duplicates this.

Fixes: #12768
Fixes: 8301906
2023-11-11 03:34:00 +00:00
Dudemanguy 9c8b8ac9d9 wayland: obey initial size hints set by the compositor
In the past, this worked by accident because the initial startup was
racy and sometimes the initial firing of handle_toplevel_config would
happen after reconfig. Since we now properly wait on all compositor
events we can save the initial size hint that is given to us and try to
use that as the window-size/geometry provided the --autofit/geometry
options aren't explictly set. Fixes #11134.
2023-11-10 22:41:35 +00:00
der richter fc4db187d0 cocoa: remove OpenGL cocoa backend
the OpenGL cocoa backend was deprecated in 0.29, it has lot of bugs, is
completely unmaintained and can't properly playback anything anymore on
the newest macOS. it is time to remove it.
2023-11-10 14:54:37 +01:00
der richter a54cc02341 mac: change display name retrieval to localizedName NSScreen property
the old displayName property via the IODisplay API is not working
anymore on ARM based macs and was broken in at least one other case.

instead we use the new localizedName property introduced in 10.15 of the
NSScreen. we don't need any backwards compatibility since 10.15 is the
oldest version we support now.

configs and scripts that use the options and properties fs-screen-name,
screen-name or display-names need to be adjusted since the names could
differ from the previous implementation via the IODisplay API.

Fixes #9697
2023-11-10 14:30:32 +01:00
der richter 040a921964 mac: fix build on older swift versions
this is apparently something that was added with swift 5.5, though it is
hard to find anything officially.

don't capture self in closure but explicitly access all variables by
prepending self.

Fixes #12653
2023-11-10 14:29:23 +01:00
der richter 1c98ab6239 TOOLS/macos-sdk-version: remove legacy sdk version retrieval
older macOS dev tools were inconsistent with the way how SDK versions
were returned, some truncated the minor versions. in those cases the
SDK version had to be retrieved through the SDK build version.

recently the scheme for the SDK build version changed that our heuristic
for converting it to an SDK version produced wrong version strings.
the stride of the minor version changed from 1 to 2, so SDK versions
ended up higher than they actually were. furthermore macOS 11 was
hardcoded.

since Xcode 12 Apple fixed the SDK version retrieval and it is no longer
truncated when using Xcode as dev tools. Xcode 12 is also the latest
supported version on macOS 10.15, which is also our oldest supported
version. we can remove the old SDK build version conversation and use
the Xcode only tool to retrieve the SDK version in the case Xcode is
used as dev tools. furthermore this als keeps support for Xcode 11 where
the problem wasn't fixed yet, but is still a supported version on macOS
10.15.

Fixes #9907
2023-11-10 14:28:39 +01:00
sfan5 b4e14b9420 vo_gpu_next: overwrite cache files atomically 2023-11-10 11:26:10 +01:00
sfan5 8f8b63d622 osdep/io: implement rename() wrapper
This is needed to provide the POSIX behaviour of transparently
overwriting existing paths.
2023-11-10 11:26:10 +01:00
sfan5 cad24deea1 vo_gpu_next: refactor cache saving code
No functional change.
2023-11-10 11:26:10 +01:00
Dudemanguy f67478f8b2 DOSC/input: clarify a couple of commands where no-osd has no effect
This should be the intuitive expectation, but it's worth noting the
deviation.
2023-11-09 21:32:35 +00:00
Dudemanguy 5c2051b1ad player/command: make show-progress work regardless of osd prefix
Having the show-progress command obey no-osd is nonsensical and
unintuitive. The show-text command already ignores no-osd, so there's
precedence for this. Fixes #5662.
2023-11-09 21:32:35 +00:00
Kacper Michajłow 7d86807a5f vo: don't sleep 1ms always when requested time is in the past
Fixes a899e14b which changed clamp from 0 to 1 ms which effectivelly
introduced 1ms sleep always, even if requested until_time_ns is in the
past and should request 0 timeout.

While at it also fix mp_poll wrapper to respect negative timeout which
should mean infinite wait.

Also keep the 37d6604 behaviour for very short timeouts, but round only
the ones > 100us, anything else is 0.

Fixes: a899e14b
2023-11-09 21:31:58 +00:00
Dudemanguy a89ba2c749 vo: replace some magic numbers with timer macros
Most importantly, the wait_until addition was missed while doing the
unit conversions to nanoseconds which meant mpv woke up roughly every
second since not nearly enough time was added. It was meant to be 1000
seconds (1e9 in microseconds). Use a macro so it's more readable. Also
put some other wild 1e9 calculations inside of a macro as well.

Fixes a899e14bcc.
2023-11-09 21:31:58 +00:00
Kacper Michajłow dffaa9cf6b demux/lavf: don't use deprecated side data
Fixes rotation metadata no longer works.

See: 5432d2aaca
Fixes: #12836
2023-11-09 21:30:50 +00:00
NRK 04b220731e editorconfig: add max line
if we're going to have an editorconfig, might as well make it accurately
reflect the coding guide.

also set trim trailing whitespace to true.
2023-11-09 21:30:25 +00:00
der richter 23de1deaaa mac: remove runtime checks and compatibility for macOS older than 10.15
we stopped supporting macOS older than 10.15 and hence can remove all
the unnecessary runtime checks and compatibility layers.
2023-11-09 18:12:25 +00:00
Dudemanguy a5bf211e12 meson: remove several macos-10-* build options
These have been build options since the waf build, but that doesn't
really make sense. The build can detect whatever macOS sdk version is
available and then use that information to determine whether to enable
the features or not. Potentially disabling multiple sdk versions doesn't
really make any sense. Because f5ca11e12b
effectively made macOS 10.15 the minimum supported version, we can drop
all of these checks and bump the required sdk version to 10.15. The rest
of the build simplifies from there.
2023-11-09 18:12:25 +00:00
Kacper Michajłow 051ba909b4 player/loadfile: remove blank line on exit 2023-11-08 21:55:08 +00:00
Kacper Michajłow 82451bdf04 msg: ensure status line is always visible
Restore last status line if it has been cleared by another message.
2023-11-08 21:55:08 +00:00
Kacper Michajłow 5c3faf71e8 msg: factor out print code
Will be useful for next commit.
2023-11-08 21:55:08 +00:00
Kacper Michajłow 773f72e6c6 msg: convert dump_stats to bstr 2023-11-08 21:55:08 +00:00
Kacper Michajłow 0853c719f1 msg: use bstr for partial msg 2023-11-08 21:55:08 +00:00
Kacper Michajłow 2fdb1d31ae msg: check isatty separately per each stream 2023-11-08 21:55:08 +00:00
Kacper Michajłow db77d7836e Revert "player: cut off status line on terminal width"
No longer needed, wrapped status line is supported now. Also this didn't
work correctly if status were decorated with module name or time.

This reverts commit ab6fac43b4.
2023-11-08 21:55:08 +00:00
Kacper Michajłow 54a7acb7dc Revert "player: don't print status line again when quitting"
This workaround is not longer needed.

This reverts commit cdc05c33b3.
2023-11-08 21:55:08 +00:00
Kacper Michajłow 24270b8587 msg: refactor how terminal messages are printed
- prepare string before printing
- reduce amount of fflush(), especially for multiline messages
- clear status line and keep it always at the bottom
- indent module name to the longest value
- disable cursor for status line
- properly support wrapped status line

Overall makes status line less flickering and remove stray status
instead of scrolling them up.
2023-11-08 21:55:08 +00:00
Kacper Michajłow e682834234 stats.lua: disable ASS formatting when printing to terminal 2023-11-08 21:55:08 +00:00
Kacper Michajłow d0b8472e5a msg: don't mix partial log messages, with unrelated log levels 2023-11-08 21:55:08 +00:00
Kacper Michajłow 477a0f8318 vo: replace VOCTRL_HDR_METADATA with direct VO params read
Currently VOCTRL are completely unusable for frequent data query. Since
the HDR parameter addition to video-params, the parameters can change
each frame. In which case observe on those parameter would be triggered
constantly. The problem is that quering those parameters involves VOCTRL
which in turn involves whole render cycle of delay.

Instead update VO params on each draw_frame. This requires changes to VO
reconfiguration condition, but in practice it should only be triggered
when image size or data layout changes. In other cases it will be
handled internal by VO driver.

I'm not quite happy with this solution, but don't see better one without
changing observe/notify logic significantly. There is no good way
currently to handle VOCTRL that are constantly queried.

This adds unfortunate synchronization of player command with VO thread,
but there is not way around that and if too frequent queries of this
param becomes a problem we can thing of other solutions.

Changes the way to get data from VO driver added by a98c5328dc

Fixes: 84de84b
Fixes: #12825
2023-11-08 21:45:07 +00:00
Thomas Weißschuh a96d26e63a audio: avoid unnecessary silence padding in read_buffer()
Not all callers of read_buffer() require the buffer to be padded with
silence.
2023-11-08 20:26:23 +01:00
Thomas Weißschuh 0b43b74c15 ao_audiotrack: switch to ao_read_data_nonblocking() 2023-11-08 20:26:23 +01:00
Thomas Weißschuh 36d5b52612 ao_coreaudio: switch to ao_read_data_nonblocking() 2023-11-08 20:26:23 +01:00
Thomas Weißschuh 5aa2068270 ao_pipewire: switch to ao_read_data_nonblocking()
Avoid blocking the process callback as it runs with realtime privileges.
2023-11-08 20:26:23 +01:00
Thomas Weißschuh 4a134f441d audio: introduce ao_read_data_nonblocking()
This behaves similar to ao_read_data() but does not block and may return
partial data.
2023-11-08 20:26:23 +01:00
Kacper Michajłow a5c32ea52e threads-win32: add comment about local decl of a function 2023-11-08 04:32:10 +00:00
Kacper Michajłow 2ae56e78dd threads-win32: support UWP in mp_thread_set_name 2023-11-08 04:32:10 +00:00
Kacper Michajłow add2f3c8c9 meson: add missing source file for UWP 2023-11-08 04:32:10 +00:00
Kacper Michajłow fa0929bf71 osdep/threads-posix: use CLOCK_MONOTONIC if supported 2023-11-08 04:32:10 +00:00
Kacper Michajłow 0a6c179026 osdep/timer-linux: check clock availability on init 2023-11-08 04:32:10 +00:00
Dudemanguy 468b9bede7 DOCS/option: discourage the use of video-latency-hacks a bit more
Who knows why this exists but maybe it's possibly useful in some obscure
case. Probably worth mentioning that it could break other options.
2023-11-08 00:11:34 +00:00
Niklas Haas 293fe9d74a vo_gpu_next: add --target-gamut option
Fixes: https://github.com/mpv-player/mpv/issues/12777
2023-11-08 00:55:39 +01:00
Guido Cella c798f66343 stats.lua: remove unused variable
056072bf95 deleted the only use of property_list.
2023-11-07 20:58:30 +00:00
Guido Cella 5c2cdb749d console.lua: don't print the console log to the OSD when switching VO
Fixes #12735, fixes #12839.
2023-11-07 20:49:44 +00:00
Dudemanguy 00533ccdae player/command: handle force window on runtime vo changes
Without this, changing the vo at runtime with --force-window --idle
would kill the vo.
2023-11-07 20:49:36 +00:00
Christoph Heinrich 69c4ed585d stats: don't overwrite color and alpha of `osd-back-color` 2023-11-07 20:48:37 +00:00
Christoph Heinrich 2406a89e00 console: don't overwrite color and alpha of `osd-back-color` 2023-11-07 20:48:37 +00:00
Mohammad AlSaleh d470766000 sub: add --sub-stretch-durations option
Stretch a subtitle duration so it ends when the next one starts.
 Should help with subtitles which erroneously have zero durations.

 I found such a subrip substitles stream in the wild.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2023-11-07 20:46:40 +00:00
Kacper Michajłow c2b3d967ba player/command: fix typo in sig-peak value computation
Fixes: 73fbe09a49
2023-11-07 20:59:46 +02:00
Kacper Michajłow 6dafc44ed0 win32: fix hit test using client rc instead window
windowrc in vo_w32_state is actually client size, for hit test we need
proper window size. When border is disabled those sizes are the same,
but when only title bar is disabled it is not.

Reduce the hit area to more sane values when the border is not
drawn to minimize amount of covered client area in borderless mode.
2023-11-07 16:42:28 +00:00
sfan5 242066a5ef vo_gpu: apply ICC profile and dithering only to window screenshots 2023-11-07 16:15:19 +01:00