Commit Graph

53501 Commits

Author SHA1 Message Date
Guido Cella
8ed672ffc8 osc.lua: add slimbottombar and slimtopbar layouts
Add layouts with only the top line of bottombar to be used with images.
2025-01-05 21:24:02 +01:00
Tim Lodemann
31d1defb7a ao_openal: fix null pointer dereference when creating OpenAL context
When the monitor goes to sleep, the OpenAL context was not properly
handled, resulting in a null pointer dereference and a crash. This
fix ensures that the OpenAL context is created and set correctly,
avoiding crashes under these conditions.

Fixes: #15648
2025-01-05 21:22:35 +01:00
Barnabás Pőcze
55f41fd8fa ao/pulse: only print server protocol after connection
The server's protocol version is not available until a connection is
properly established. Currently the value of `PA_INVALID_INDEX` is printed
due to calling `pa_context_get_server_protocol_version()` before connecting.

Fix this by doing the call after the connection has been set up.

Fixes: f744aadb77 ("ao_pulse: dump library version etc.")
2025-01-05 21:21:52 +01:00
Guido Cella
850e03d29f console.lua: add pause_on_open script-opt
Add a script-opt to pause when console opens and unpause when it closes,
disabled by default.

This is particularly useful for selectors that take several seconds to
open so you don't have to guess when to pause, like the subtitle line
selector with embedded subtitles, or my script which lets you select
which lyrics to download after requesting them with curl.
2025-01-05 21:21:32 +01:00
Kacper Michajłow
44384aad73 github/workflows/lint: add pre-commit hooks
Tests some basic errors in files like trailing white-spaces.
Additionally check the spelling with codespell.
2025-01-05 01:18:28 +01:00
llyyr
baecbb12fa sub: add sub-scale-signs
Allows --sub-scale to alow scale typesetting
2025-01-05 01:14:42 +01:00
Guido Cella
996e58a738 stats.lua: only reprint stats on video-reconfig when toggled
Make this behave like the comment says it should, because currently when
you show oneshot stats and change file, stats are printed again and hide
--osd-playing-msg. This happens even if you hide the stats by
show-texting something else and change file before the timer expires.
2025-01-05 00:52:49 +01:00
Guido Cella
2e1bc3cf26 osc.lua: allow adding custom buttons 2025-01-05 00:50:35 +01:00
Guido Cella
9db941ff8f osc.lua: add cache_enabled() helper 2025-01-05 00:50:35 +01:00
Filip Hejsek
0a0ceb7439 vulkan/context_display: implement display fps and resolution info
Implement VOCTRL_GET_DISPLAY_FPS and VOCTRL_GET_DISPLAY_RES by returning
values obtained from Vulkan.

Currently, display fps and resolution info is not available in the
displayvk context. Display fps is needed for display sync to work
properly. The information is also used as the value of a few properties.

This slightly improves parity with the drm context.
2025-01-04 22:40:03 +00:00
Kacper Michajłow
297c8cccf3 ci/win32: bump test timeout to 240 seconds
Avoids timeout of libplacebo/d3d11.c test that takes ~120s on Microsoft
software implementation.
2025-01-04 21:45:25 +01:00
Guido Cella
0d9763872c stats.lua: fix page 2 and 0 layout
Fixes d84e1b3582.
2025-01-04 20:45:31 +01:00
Guido Cella
d84e1b3582 stats.lua: inherit --osd-shadow-offset
Unlike font and border sizes, the default stats shadow offset is 0 like
--osd-shadow-offset, so it can be inherited from it by default to not
make users configure it in 2 places.

Since 0 and negative numbers are valid offsets, use infinity as the
placeholder for unconfigured values.
2025-01-04 20:07:49 +01:00
Kacper Michajłow
fc6ce44221 github/workflows/lint: remove -lint suffix from lint workflow job names 2025-01-04 20:03:46 +01:00
nanahi
221f54d1f9 DOCS/man/input.rst: mark flags as optional
They are not required but the current documentation only indicates
this to some commands but not for others.
2025-01-04 20:01:25 +01:00
der richter
64aeb4273d mac/app: make const char pointers to const pointers
they were meant to be immutable. imported in swift as mutable pointer,
which leads to errors with the strict concurrency in swift 6.

make the pointers const.
2025-01-04 17:04:21 +01:00
der richter
d03ce00127 mac/app: make re-assignment of complex macros const
they were never meant to be mutable and are imported as mutable vars
in swift. that causes errors with the strict concurrency in swift 6.

make them const/lets and immutable.
2025-01-04 17:04:21 +01:00
Guido Cella
2dcf69655a console.lua: complete playlist-play-index none 2025-01-04 16:52:01 +01:00
Guido Cella
6f8d8a38c4 console.lua: apply --osd-selected-color to selected completions 2025-01-04 16:22:20 +01:00
Kacper Michajłow
497310a235 Revert "demux_edl: disallow nested edl to avoid infinite loop"
Apparently there are some scripts that use nested edls instead of
flattening them first, so let's live with this.

This reverts commit de42e11662.
2025-01-04 16:13:07 +01:00
Kacper Michajłow
96da0cbcbd options: remove the player argument from --media-controls
It is now handled internally by the libmpv profile.

Since `player` was the default option, the impact should be minimal, as it
is uncommon to override the default option with the same value.
yes/no args will function the same way as before this commit.
2025-01-04 15:16:40 +01:00
Kacper Michajłow
50d7d33777 LICENSE.{GPL,LGPL}: update to upstream version
Downloaded from:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt

Non-printable characters stripped from LICENSE.LGPL.
2025-01-04 15:04:38 +01:00
Kacper Michajłow
59d1dc43b9 various: fix typos 2025-01-04 15:59:49 +02:00
Kacper Michajłow
efcee92d0e various: remove double new line at the end of file 2025-01-04 15:59:49 +02:00
der richter
c1e0e32453 mac/remote: use swift closure instead of obj-c selector bridging
it's unnecessary to use the overhead of an obj-c selector and the
resulting bridging.
2025-01-04 13:33:15 +01:00
Kacper Michajłow
257395de99 ci/build-common: remove executable flag
This file is sourced.
2025-01-03 22:37:03 +01:00
Guido Cella
3f084477ad osc.lua: bind middle clicking play pause to cycle loop-playlist 2025-01-03 21:08:28 +01:00
Misaki Kasumi
06fe665b78 ao_coreaudio: set kAudioOutputUnitProperty_ChannelMap
This fixes #15584
2025-01-03 13:44:00 +01:00
Guido Cella
c9a99db26c console.lua: don't set the cursor color
This makes no visible difference, only the border color is visible, as
the border is drawn on top of the regular color.
2025-01-03 13:02:10 +01:00
Guido Cella
ab25b3d852 console.lua: inherit --osd-back-color in the cursor
3dcc661de7 made the cursor reset to Default style to not apply the blur,
but \blur0 achieves that without resetting every user style. The cursor
can thus respect the user's --osd-back/shadow-color.
2025-01-03 13:02:10 +01:00
Guido Cella
2ecbe8d83b console.lua: inherit --osd-color in the cursor
Following up 19537a4996, also respect the user-specified color in the
cursor. But the cursor is drawn as a border, so we actually need to use
--osd-color as the border color.
2025-01-03 13:02:10 +01:00
Guido Cella
4e8452aee8 console.lua: inherit --osd-shadow-offset
It was requested in
https://github.com/Samillion/ModernZ/issues/259#issuecomment-2556608926
to make console's shadow offset consistent with --osd-shadow-offset. Not
specifying shadow offsets achieves that. This disables console's shadow
by default but there is no reason console should default to having
shadows but the rest of the OSD shouldn't. Users who want shadows can
enable them in the whole OSD with --osd-shadow-offset. console-specific
shadow_{x,y}_offset script-opts can be added if someone requests them
later.
2025-01-03 12:56:10 +01:00
Guido Cella
f21b3f8f06 console.lua: inherit --osd-back-color
The previous commit changed --osd-back/shadow-color to nearly the same
one console was using. This allows unhardcoding it from there and using
--osd-back-color even with --osd-border-style=outline-and-shadow for
consistency with the rest of the OSD.
2025-01-03 12:18:03 +01:00
Guido Cella
fab8848d7d sub/osd: default to a semitransparent black back color
By default OSD and subs have no shadow, but if you do set a
--osd/sub-shadow-offset, the current default white shadow color looks
bad around white text with black border. Default to semitransparent
black instead. Use the same color box profiles were using to allow
removing it from there.
2025-01-03 12:18:03 +01:00
Guido Cella
00ff6e5ae2 console.lua: remove useless assignment
The lines in populate_log_with_matches()

if selected_match < first_match_to_print then
    first_match_to_print = selected_match

will set first_match_to_print to 1 even if it is not set here since
handle_edit() sets selected_match = 1.
2025-01-03 11:25:22 +01:00
Guido Cella
f3ed94b74d console.lua: focus the default item after emptying the input line
When console is opened with selectable items and a default item, the
default item is placed at the center. But if you type something and then
clear the line, the first item becomes the selected one. Make it select
the default item and place it in the center in this case too.
2025-01-03 11:25:22 +01:00
Kacper Michajłow
e01f75e636 version.h.in: bump copyright year 2025-01-03 01:21:15 +01:00
der richter
8af05d4fa1 mac/swift: fix global variables for upcoming swift 6 concurrency
fixes problems with upcoming features DisableOutwardActorInference,
GlobalConcurrency and InferSendableFromCaptures for swift 6 strict
concurrency. enabled with -enable-upcoming-feature flag.
2025-01-02 15:12:28 +01:00
Neko Asakura
50042f5ee0 mac: add support for --force-window-position 2024-12-31 14:49:39 +01:00
der richter
1551cef54e mac/remote: add Quick Look thumbnail as cover fallback
since we load covers/images directly in a our own thread and the quick
look thumbnailing also works asynchronously on its own thread, we need
sync/coordinate both threads. otherwise it would be possible that a
cover from a different file could overwrite the cover of the current
file.

to prevent this every cover generation has a unique timestamp and only
covers for the last cover timestamp will ever be shown.

we are also not interested in icon type thumbnails, since those are just
generic file type icons.

quick look thumbnails can only be generated if quick look can read those
files. files unknown to macOS don't work out of the box and you need to
install a quick look extension for this, "QuickLook Video" for mkv.
2024-12-31 14:44:16 +01:00
Callum Moffat
748fc2b752 ao_audiounit: add --audio-exclusiv support, make non-exclusive default 2024-12-31 13:51:44 +01:00
Guido Cella
11dcd445d9 osd: remove unused constants
OSD_STOP was never used.
OSD_BALANCE is unused since 3d27a0792b.
OSD_PB_* are unused since ef3c0e6eda.
2024-12-31 11:16:45 +01:00
Guido Cella
551cec9d95 DOCS/man/mpv: document that you can deselect the current track
Some users did not realize this is possible.
2024-12-31 11:09:33 +01:00
Guido Cella
4df89532e1 DOCS/man/input: edition-list/N/id is not writable
I added RW to edition-list/N/id in 34f2143e8f because in #8077 it was
assumed that it is writable from the wording of the docs. But what the
docs actually meant is that you can retrieve edition-list/N/id and then
use the retrieved value to set the edition property.

Remove RW and the ambiguous sentence.
2024-12-31 10:37:14 +01:00
Misaki Kasumi
e325959980 subprocess: fix reset_signals_child missing last signo 2024-12-31 10:16:50 +01:00
Guido Cella
50a3da73b7 select.lua: fix select-edition crash on non-MKVs
In files other than MKVs edition-list is an empty table, not nil. It is
current-edition that is nil.

However nil still needs to be checked to not crash with mpv --idle.
2024-12-31 10:13:38 +01:00
Kacper Michajłow
1dd0e49f83 stream_file: don't allow to open standard streams during fuzzing
To avoid all sorts of I/O loops.
2024-12-29 20:14:00 +01:00
llyyr
83bb49815c DOCS/man/vo.rst: improve dmabuf-wayland documentation 2024-12-28 19:57:52 +00:00
Kacper Michajłow
c5668729be sub/lavc_conv: free avctx correctly on error
Fixes memory leak on error.
2024-12-28 17:52:37 +01:00
Kacper Michajłow
66321465dc m_option: free channels before overriding in parser
Fixes memory leak when --audio-channels option is passed multiple times.
2024-12-28 17:52:37 +01:00