Commit Graph

53125 Commits

Author SHA1 Message Date
der richter e661165ead github/workflows: add editorconfig linting 2024-10-24 17:40:26 +02:00
Guido Cella ef6eda32a2 command: print track metadata when changing track 2024-10-24 17:39:46 +02:00
Guido Cella f0a852cda3 command: print lang in track-list 2024-10-24 17:39:46 +02:00
Guido Cella b1037f5d63 loadfile: reuse circle definitions in command.h 2024-10-24 17:39:46 +02:00
Guido Cella 3ea8d751f5 command: print track metadata in ${track-list}
Extract track metadata formatting out of loadfile.c to reuse in the
track-list property.
2024-10-24 17:39:46 +02:00
Guido Cella 1bee15d5da laodfile: remove redunant track type check
The data within the checks is unavailable if the track isn't of that
type, so there is no need to check the type.
2024-10-24 17:39:46 +02:00
llyyr c5561b8e09 demux_playlist: fix comparison for current file if it's in current dir
When the file is in the current working directory, stream->path points
the path user passed as arg, so it may or may not include './'.

Strip it from both to make the comparison work

Fixes: c201c4874d
2024-10-24 12:34:58 +02:00
Dudemanguy 851df7088a video/out/gpu/context: prefer vulkan over opengl when reasonable
For most actual desktop users, vulkan should be the a superior
experience over opengl as this point and our autoprobe should pick that.
For linux users, vulkan on wayland is rapidly seeing improvements and is
far ahead of egl. There is no sign of that changing anytime soon and
working fifo is on the horizon, so really wayland users should just all
be using vulkan from now on. For x11, there is not a big difference
between using egl vs vulkan as far as I know and both work well. macOS
already prefers the vulkan backend over the libmpv one anyways, and
finally windows still defaults to d3d11. Probably virtually no one uses
opengl on windows, but vulkan is reasonably common among windows users
and it doesn't make any sense to prefer opengl over it.

The two outliers here are Android and VK_KHR_display. On Android, vulkan
drivers are probably just a total disaster and let's not put ourselves
in that mess if there's no reason to. For VK_KHR_display, it actually
works fine except for one really big problem: VT switching doesn't work.
If you try it, enjoy losing all input and being forced to do a hard
reboot. It might be fixable if you use logind or something, but the
method of using signals like the drm context does won't work because
VK_KHR_display uses render nodes not primary nodes. Also, the opengl drm
context could support hdr in theory (some attempts were made but none
succesful) so it is probably "better". Maybe. Anyways, for these two
platforms, we still prefer opengl.
2024-10-23 19:09:20 +00:00
der richter a8d91b0b13 mac/vulkan: add retrieval of color depth and return auto (0)
this effectively disables the workaround that picks the color/dither
depth based on the source and instead picks it based on the output
surface/pixel format.

macOS apparently always operates at 10bit internally regardless of the
display's bit depth. this changed at some point in the more recent macOS
versions, where previously macOS operated at a frame buffer depth
corresponding to the display. either 30-Bit Color (ARGB2101010) for
10bit or 24-Bit Color (ARGB8888) for 8bit.

Fixes #13767
2024-10-23 19:39:20 +02:00
der richter 3c76afa05b vo_gpu_next/vulkan: add mechanism to retrieve color depth in gpu context 2024-10-23 19:39:20 +02:00
Rasmus Porsager 3d443cb267 x11: fix --fs-screen=all
The logic for getting the display edges was wrong and always resulting in 0 0 0 0 instead of the full desktop. This also fixes #11716
2024-10-23 14:22:39 +02:00
Guido Cella dec1b00a75 DOCS/man/osc: update default playlist mbtn_right bindings 2024-10-23 14:22:14 +02:00
Guido Cella f999b0a5c8 osc.lua: don't show the osd-bar on chapter navigation
It is redundant if you're already using the OSC, so only show the
chapter text. Also fix the documented default commands of these buttons
which were outdated.
2024-10-23 14:22:14 +02:00
Guido Cella 165159fdef osc.lua: cycle window-maximized when right clicking fullscreen
And add script-opts to configure the fullscreen button bindings.
2024-10-23 00:21:15 +02:00
Guido Cella dab5cf4ab0 osc.lua: toggle looping when right clicking playpause
Inspired by ModernX.

Closes #5067.
2024-10-22 22:44:21 +02:00
Guido Cella a80f535a6d osc.lua: make mouse bindings customizable
This adds several script-opts to configure what OSC buttons do when
clicked. It lets you restore the bindings present before they were
changed to call select.lua.

The script-opts are listed one per line in the manual to not make that
section huge.

skip_backward and skip_forward script-opts are omitted to lower the
script-opts number because they are only in box layout and undocumented.

I'm not sure if it's worth adding script-opts for the wheel on the
seekbar.

script-opts for the current and remaining time and fullscreen are not
added to not add more script messages.

Closes #6291 and #11878.
2024-10-22 22:44:21 +02:00
Guido Cella 8e327f28b4 osc.lua: default chapters_osd and playlist_osd to false
There is a consensus that showing these list when navigating is
distracting. Also if you set --osd-playing-msg, the playlist is briefly
displayed and then overwritten by the msg. The chapter list can even
contain spoilers:
https://github.com/mpv-player/mpv/issues/4675#issuecomment-978840475

The next commit will remove these completely in favoring of making the
commands customizable.
2024-10-22 22:44:21 +02:00
Guido Cella e6db75b04a osc.lua: rename buttons
Give buttons nicer names before exposing script-opts for their bindings.
In particular, rename cy_audio and cy_sub to audio_track and sub_track
because their left click binding no longer cycles.
2024-10-22 22:44:21 +02:00
Guido Cella c24c9027af osc.lua: bind middle button down instead of up for tracks
This makes it consistent with most other bindings and lets you cancel
the operation by moving the cursor away (the seekbar bind mouse down so
you can keep seeking to different timestamps).
2024-10-22 22:44:21 +02:00
Guido Cella cd2acb477c osc.lua: open select.lua by clicking buttons
8bf5548 added mouse support to the console's select menu, so open it
from OSC buttons.

Left click on the title opens the playlist selector and showing the
stats is moved to right click.

Right click on chapter buttons opens the chapter selector.

Left click on track buttons opens the track selectors because seeing
which track you're selecting beforehand is useful.

Fixes #10621.
2024-10-22 22:44:21 +02:00
Guido Cella 68e2b51066 osc.lua: show stats page 5 when clicking the title
Now that the playlist counter is shown by default there is no use in
showing it again, so repurpose the binding to show the stats page with
file and track info.
2024-10-22 22:44:21 +02:00
Guido Cella 8ca7386a38 osc.lua: add osc-hide script-message
This will be used to hide it when opening select.lua.
2024-10-22 22:44:21 +02:00
Guido Cella f156461360 osc.lua: show the playlist position when playing multiple files 2024-10-22 22:27:40 +02:00
Guido Cella 8aad03bf6d command: don't print unneeded new lines for track-list
Useful for terminal output.
2024-10-22 20:17:14 +02:00
Kacper Michajłow 153d4927ab options: add --script-opt alias for --script-opts-append 2024-10-22 18:54:16 +02:00
Kacper Michajłow 4045fac980 osdep/io: remove duplicated code for error to string conversion
This also removes \n from the end of the string, which shouldn't be
present in this string.
2024-10-22 18:53:18 +02:00
Guido Cella 7a652344ee osc.lua: seek to the nearest chapter when right clicking the seekbar
This allows seeking to the start of a chapter without exactly clicking a
chapter mark.

Inspired by ModernX.
2024-10-22 18:52:56 +02:00
Mohammad AlSaleh d027e02d37 vo_gpu_next: raise LUT file max size and report an error if exceeded
First of all, `lutdata` was passed to `pl_lut_parse_cube()` even if
 it was empty. This caused a bogus error message to be printed by
 the LUT parsing code in libplacebo.

 "[vo/gpu-next/libplacebo] Missing LUT size specification?"

 One of the reasons why `lutdata` can be empty is if the LUT file size
 exceeds the `max_size` limit passed to `stream_read_file()`.

 So in this commit, `lutdata` is checked first before getting passed to
 libplacebo, and a non-bogus error message is printed if it's empty.

 And secondly, the max size allowed is raised from the quite limiting
 value of 100MB to 1.5GiB. The new max matches the limit in LUT cache
 which is used to support up to 512x512x512 LUTs.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-10-22 18:49:21 +02:00
nanahi 25ccae9216 player/javascript: disable stream error logging
Failure to open a file here should not be treated as an error
if the exception is handled by the script.
2024-10-22 03:16:51 +03:00
nanahi bd5e3c0261 stream: allow max_size of 0 for stream_read_complete
In this case, it returns a bstr of a length of 0 rather than
error.
2024-10-22 03:16:51 +03:00
nanahi 2af0b0b34b player/javascript: allow reading partial result for af_push_file
ca7006a6a2 replaced file reading with
stream_read_file which results in error when af_push_file is used
to test existence with 1-byte limit. Fix this by using
STREAM_ALLOW_PARTIAL_READ flag to restore the old loading behavior.
2024-10-22 03:16:51 +03:00
nanahi dd23bf1555 demux_playlist: use STREAM_READ_FILE_FLAGS_DEFAULT 2024-10-22 03:16:51 +03:00
nanahi dc0d99eaff stream: add STREAM_READ_FILE_FLAGS_DEFAULT
This is the default set of flags used by stream_read_file().
Useful for doing flag customization for stream_read_file2().
2024-10-22 03:16:51 +03:00
nanahi c2e71ceb07 stream: add STREAM_ALLOW_PARTIAL_READ flag
This allows stream_read_complete() to return partial result
instead of error if the file size is larger than the limit.
2024-10-22 03:16:51 +03:00
nanahi fad946d778 player/javascript: use af for stream_read_file talloc context
Needed because js_pushlstring can throw and skip the free below.
2024-10-22 03:16:51 +03:00
Sam 2173565b56 osc.lua: replace escaped double quotes with single quotes 2024-10-22 00:02:38 +02:00
Guido Cella 0dc2e85ff8 console.lua: exit when left clicking outside of selectable items 2024-10-21 22:25:54 +02:00
Kacper Michajłow 1edc02174f workflows/comment: don't error out on closed pull requests
If the pull request is not found or is not open, it should not be
treated as a critical error. This situation can occur after a merge.
There is no reliable way to query a pull request from a workflow_run
event, so this has been made a non-error log.
2024-10-21 21:11:24 +02:00
Kacper Michajłow 649e397034 workflows/build: remove safe.directory git config
It has been set in our docker container.
2024-10-21 21:02:38 +02:00
Guido Cella 15ad917bb1 stats.lua: remove term_height_limit script-opt
It is excessive control to manually configure the terminal height limit
just for stats, if anything this should be added as an option used all
throughout mpv.
2024-10-21 20:07:01 +02:00
Guido Cella d6951e4039 stats.lua: don't print the scroll hint with bindlist 2024-10-21 20:07:01 +02:00
Guido Cella a187110f4a stats.lua: clip lines with ${term-clip-cc}
Use the property introduced in bf025cd289 to clip the lines of stats.lua
with accurate unicode width detection and considering --msg-module and
--msg-time. This allows removing the term ellipsis functions.

Also use script-opts-append instead of script-opts in the docs so
script-opts in mpv.conf, which could change keybindings, are not
overriden.
2024-10-21 20:07:01 +02:00
Guido Cella f72f6b0fc4 stats.lua: indent terminal output with 4 spaces instead of tab
Because the default tab width of 8 cells wastes too much space, and 4
spaces is closer to the width of ass_indent.
2024-10-21 20:07:01 +02:00
Guido Cella 869484d91e DOCS/man/stats: bindlist: use --script-opts-append
Use --script-opts-append=bindlist instead of --script-opts to not
overwrite script-opts in mpv.conf, which may set different key bindings.
2024-10-21 20:07:01 +02:00
Kacper Michajłow 0c4c2caabf misc/codepoint_width: assume tabstop width to be 8
It has been hardcoded to the same value in stats.lua so keep the current
behaviour. Can be made configurable if requested in the future.
2024-10-21 20:06:48 +02:00
Kacper Michajłow cd62cc7ecb player/osd: don't add newlines when message would be empty anyway
When only control char is present there is no point to add part for it.
2024-10-21 20:06:48 +02:00
Kacper Michajłow 201a39d7fa msg: skip formatting if there is only control char present
This doesn't change behaviour just skips some redundant code early.
2024-10-21 20:06:48 +02:00
Kacper Michajłow 3cf0f8309f msg: add newline conditionally
In idle mode, there is not status line and we sometimes want to have
output without last new line, which were always added after truncation.

Also, make sure we don't overwrite important chars with ellipsis, this
could happen when cut point is near the end.

Fixes: bf025cd289
2024-10-21 20:06:48 +02:00
Dudemanguy 0f78584518 x11: remove nvidia blacklist logic from --x11-present=auto
When the present extension was originally implemented, nvidia was
specifically blacklisted. The reason was because at the time it would
give bogus values that appeared to be real but actively made playback
worse. So out of an abundance of caution, any nvidia detection at all
(e.g. on a multi-gpu system) would disable the use of the extension.
Well times have changed and actually presentation-time on wayland for
nvidia works now amazingly enough. For xorg, the extension still doesn't
work, but from user testing it does not seem to be harmful anymore. It
just does nothing. So we can remove the blacklist part and just only use
a whitelist. Like before, we only enable the extension for mesa drivers
by default so no practical change for anyone except multi-gpu systems
whom may have this enabled now but should not see any negative behavior
change.
2024-10-21 15:13:47 +00:00
Guido Cella 0490a89ba6 DOCS/man/input: input-bindings can change at runtime
This paragraph is clearly wrong. load-input-conf was recently added, but
even before that the enable-section and disable-section commands could
change key bindings at runtime without scripts.
2024-10-21 15:13:39 +00:00