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

52564 Commits

Author SHA1 Message Date
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
nanahi
f8f47d06f4 osc.lua: add option to use display fps for update interval
If the display fps is unavailable, use the tick_delay as a fallback.
2024-06-08 13:46:11 +02:00
nanahi
fa525265b4 osc.lua: unify observe_property style 2024-06-08 13:46:11 +02:00
nanahi
6337bc27ff osc.lua: add option to make rendering smoother
OSC rendering used to be smooth (up to OSD rendering fps) before
48f906249e, but after that commit the
frame duration is hardcoded to 30 ms. This is too high and results in
choppy OSC rendering, which is very noticeable with the progress bar
while moving mouse over it or playing a short 60 fps video.

This makes the duration an option so that it can be decreased to make
OSC rendering smoother.
2024-06-08 13:46:11 +02:00
Misaki Kasumi
c55ff4176c opengl: add --egl-output-format 2024-06-08 10:23:32 +02:00
Misaki Kasumi
cd74f8f7c5 opengl: add --egl-config-id 2024-06-08 10:23:32 +02:00
Crend King
fe709c986b vf_vapoursynth: add parameter to pass arbitrary string to script
Currently the vapoursynth video filter does not accept any argument for
passing arbitrary user data. This limits what the VS script can do.

Ideally, the vapoursynth filter has an user-data parameter that contain
string value. mpv passes that value to the VS script just like
container_fps and others. Once the VS script gets the data, it can do
all sorts of data extraction and transformation.

Another benefit is that instead of mpv always have to catch up to user
needs for this filter, with this users can just pass whatever needed
themselves, thus becomes more future-proof.

Fixes #14214
2024-06-08 03:13:41 +02:00
Guido Cella
dc998560aa options: add --osd-playlist-entry
Allow configuring whether to print the media-title, the filename or both
(as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist
and in the playlist selector.

Showing only titles hides information when files are badly tagged, or
when it hides the track numbers of album songs. But showing filenames is
not as useful as titles e.g. when playing URLs with media titles. This
option lets the user choose which one to show, or show both if switching
is inconvenient.

The OSC's playlist_media_title script-opt is removed because this option
is better since it works everywhere after configuring it once.

Closes #11653.

Also show the full URLs of playlist entries instead of their basenames
in osc.lua and select.lua, consistently with mp_property_playlist().

For simplicity, this just checks if entries contain :// instead of
replicating all of mp_is_url().

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-08 01:43:15 +02:00
Crend King
d53aa6d3e2 DOCS/compile-windows.md: improve Windows build documentation
Currently the documentation for building on Windows, specifically the
"Native Compilation with Clang (Windows SDK Build)" route, could use a
few minor improvement to make the development onboarding experience more
smoothly.

Fixes #14214
2024-06-08 01:15:56 +02:00
Guido Cella
2becb971e9 console.lua: prettify unselected track log messages
After d49879f1f7 terminal escape sequences are printed in the console
log for unselected tracks. Remove them and make those lines grey.
2024-06-07 22:47:44 +02:00
Guido Cella
75645263dd select.lua: support extracting ytdl_hook subtitles
They don't work because they have EDL URLs, but we can attempt to
extract their real URLs.
2024-06-07 22:45:41 +02:00
Guido Cella
5657cd65b7 select.lua: hide the hour when it's 0
Omit the hour in the chapter and subtitle line selectors when the file
is shorter than an hour.
2024-06-07 22:45:41 +02:00
Guido Cella
8939bfc3ef select.lua: seek to the currect subtitle line when paused without video
Add an offset to sub seek correctly like in b35e34ae2f. The extra 0.01
offset apparently isn't necessary in this case.
2024-06-07 22:45:41 +02:00
Guido Cella
4059d1832b select.lua: preselect the correct sub line with duration >= 100 minutes
ffmpeg outputs timestamps like '100:00.00' in LRCs instead of adding
hours, and timestamps like '100:00' are < '10:00', so since these
strings are being compared, if there is no current subtitle line, there
are subtitle lines at >= 100 minutes, and time-pos is between 10 minutes
and 100 minutes, one of the last subtitle lines gets preselected.

Fix this by converting the timestamps to numbers before comparing them.

Also simplify the logic by merging the 2 loops to determine the default
line, and reformat the timestamps by adding hours to not print minutes >
60 in the selector, and by removing the hundredths of seconds. This
requires storing the accurate timestamps in a table to seek to them on
submit.
2024-06-07 22:45:41 +02:00
Guido Cella
d49879f1f7 loadfile: improve the format of terminal track information
Print vlang if present.

Make unselected tracks and editions grey instead of adding (+) before
selected tracks. Mark them with the same circles as show-text
${track-list} and script-message osc-tracklist when not outputting to a
TTY.

Don't print a different symbol with --sub-forced-events-only because
nobody uses this option, and subtitles are very unlikely to mix forced
and non-forced events.

Align 2-digit track IDs.

Align languages of up to 7 characters (the length of zh-Hans).

Leave spaces when a track has no language but at least another track
does to align the following track data with the other tracks.

Add a space between values and their units.

Convert Hz to kHz.

Pretty print FPS and kHz with mp_format_double().

Don't print images' FPS because it's just a bogus value taken from
--mf-fps.

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-07 22:24:25 +02:00
Kacper Michajłow
22aa570cf8 ci/mingw: install wine optionally 2024-06-07 21:12:38 +02:00
Kacper Michajłow
9f8b4b38c9 ci/mingw: use Ubuntu 24.04
This effectively bumps minimal MinGW-w64 requirement to v11.0.1. As it
is available in the latest Ubuntu LTS.

While at it clean installed packages list.
2024-06-07 21:12:38 +02:00
Kacper Michajłow
05e870f76b ci/msys2: compact build script 2024-06-07 21:12:38 +02:00
Kacper Michajłow
de1c0b5464 ci/msys2: re-enable 32-bit builds
The 32-bit builds were disabled, because some packages started
disappearing. MSYS2 is slowly phasing out 32-bit support, but since we
still support it we have to test it somehow. Recent brakage with calling
convention mismatch would be spotted a lot quicker. So enable it, but
with some, not available, packages disabled.

This reverts a56d5c7fa1
2024-06-07 21:12:38 +02:00
Kacper Michajłow
f47cbcd439 ci/mingw: don't run test on 32-bit binary
Ubuntu 24.04 linux-azure kernel, used on GHA, is compiled with
CONFIG_COMPAT_32BIT_TIME=n. This prevents running any 32-bit binaries
through wine, so disable tests when doing i686 build. 32-bit builds are
still tested on Windows.

See: https://github.com/actions/runner-images/issues/9977
2024-06-07 21:12:38 +02:00
Kacper Michajłow
dea176a7bf hwdec_vaapi: suppress comparision warning
comparison of unsigned expression in '< 0' is always false
2024-06-07 21:12:38 +02:00
nanahi
b2a4c0ce91 wayland_common: properly handle modifiers for keyboard enter keys
Wayland protocol only guarantees the delivery of modifier information after
the enter event. To handle it properly for keys pressed in the enter
event, save those keys for later processing in the modifier event.
2024-06-07 18:57:35 +00:00
Kacper Michajłow
d59a606cbd meson: add -fno-trapping-math to default flags
It is safe to enable for mpv, we don't check or care about floating
point exceptions. Allow the compiler to ignore them too.
2024-06-07 20:12:40 +02:00
Kacper Michajłow
3f84969b21 meson: add -fno-signed-zeros to default flags
It is safe to enable. Even FFmpeg enables this by default.
0415bb74c8/configure (L7521)
2024-06-07 20:12:40 +02:00
Kacper Michajłow
ac5d27fce5 ci/mingw: enable javascript support 2024-06-07 20:07:29 +02:00
UNIVPM-S1079707
b6d7f778b8 osc.lua: fix user configurable colors 2024-06-07 19:45:46 +02:00
Kacper Michajłow
8dd262ffa5 ra_d3d11: make cache header constant size regardless of the build
This makes cache entries compatible between 32-bit and 64-bit builds and
avoids issues with loading cache wrong.
2024-06-07 19:41:50 +02:00
Kacper Michajłow
d7ceedbd99 ao_wasapi: don't limit the scope of execution context
May fix broken systems like #12145 or #14314. Probably won't change
anything, but it is the correct context to use anyway.
2024-06-07 19:41:28 +02:00
Kacper Michajłow
965809f108 w32_common: stop IME initialization timer after first try
It will be set again on first key press, but no need to call IME api
every 250ms until any key is pressed.
2024-06-07 19:41:15 +02:00
nanahi
31ae111ff5 default.js: handle canceled key bindings 2024-06-06 23:38:39 +03:00
nanahi
eeb8e6e451 defaults.lua: handle canceled key bindings
There is a subtle behavior difference for built-in/input.conf key bindings
and key bindings registered by scripts: when a key binding is canceled
(e.g. a mouse button is bound to a command, is pressed down, and then
another key is pressed which is bound to another command), the command is
not invoked if the binding is built-in/input.conf, but is invoked if it's
registered by scripts, because it's handled with a different mechanism,
which gives no way for scripts to detect this.

Fix this by using the newly available canceled flag to detect this.
If a key binding is canceled, the callback is now not invoked unless
the key binding is registered with the complex option. In this situation,
the callback is invoked with the canceled state available so that scripts
can detect and handle this situation.
2024-06-06 23:38:39 +03:00
nanahi
5fcbe1c417 command: add canceled state to key-binding client message
This allows libmpv clients to know whether the key binding is canceled
and thus should normally be ignored.
2024-06-06 23:38:39 +03:00
nanahi
de97cb0964 input: mark a command as canceled if it is explicitly dropped
In certain situations (including but not limited to begin window dragging),
it is desired to cancel the current command completely. However, commands
which have on_updown flag set require the command to be invoked in this
situation. There is currently no way to know if the command is triggered
normally or triggered because it is dropped.

This adds a canceled state to mp_cmd which indicates this.
2024-06-06 23:38:39 +03:00
Kacper Michajłow
a8d95fd51a bstr: use memchr and memrchr for bstrchr and bstrrchr
May be faster to use optimized variants instead of simple loop.
2024-06-06 21:42:58 +02:00
Kacper Michajłow
a32674bb29 terminal-win: use proper NTAPI callback for FLS
Fixes crash when FLS data is attempted to be cleared.

This affects only 32-bit build where the calling convention were not
matching the expected one. It has to be __stdcall in this case.

Fixes: 3372e17d
2024-06-06 21:42:12 +02:00
Kacper Michajłow
112fa549be DOCS/compile-windows.md: update Windows compilation documentation
General update. Removed MXE as it is not supported, doesn't support
libplacebo and in general it doesn't do anything useful which native
Meson cannot do already.
2024-06-05 19:17:49 +02:00
Kacper Michajłow
00cfe1e1fd common: clang supports __builtin_clz also in non-GNU modes 2024-06-05 19:16:35 +02:00
Kacper Michajłow
0fd3fe857c parse_commandline: fix incorrect win32 check 2024-06-05 19:16:35 +02:00
Kacper Michajłow
7258ca3247 misc/thread_tools: fix incorrect win32 check 2024-06-05 19:16:35 +02:00
Kacper Michajłow
f394349066 ao_pcm: fix incorrect win32 check 2024-06-05 19:16:35 +02:00
Kacper Michajłow
f40b569426 player/main: concat string at compile time 2024-06-05 19:16:35 +02:00
Kacper Michajłow
b0aa088bc4 sub/sd_ass: rewrite is_animated()
Using strchr should be faster as it is optimized for the job. Also
ensure that tags are not escaped and are within {} correctly. This also
is important for performance as it allows to scan only needed areas of
the string.

Co-authored-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
Co-authored-by: rcombs <rcombs@rcombs.me>
2024-06-05 19:13:41 +02:00
Kacper Michajłow
0fd4c84a5e meson: clear flags used for build
Some were duplicated between GCC and Clange. Others were missing in
Clang case. Instead test all the flags and don't make assumptions that
will get invalid over time. Testing flags is almost free.
2024-06-05 19:07:58 +02:00
Kacper Michajłow
b4683fd3d8 {x11_common,context_x11egl}: suppress Wundef warning 2024-06-05 19:07:58 +02:00
Kacper Michajłow
b558b99f67 ao_pipewire: fix access to undefined byte order definitions
spa/param/audio/raw.h on FreeBSD accesses those, so defined them.
Probably should be fixed upstream, but to suppress warnings lets do it
locally.
2024-06-05 19:07:58 +02:00
Kacper Michajłow
8e4dcb15ce osdep/endian: add missing byte order defines 2024-06-05 19:07:58 +02:00
Kacper Michajłow
8657b20574 ao_coreaudio_chmap: fix shadowed variable 2024-06-05 19:07:58 +02:00
Kacper Michajłow
2e19420756 stream_cdda: suppress Wundef warning 2024-06-05 19:07:58 +02:00
Kacper Michajłow
fc0d0f10eb fuzzers/common: add prototype for LLVMFuzzerTestOneInput
To suppress warning.
2024-06-05 19:07:58 +02:00