Commit Graph

53394 Commits

Author SHA1 Message Date
Kacper Michajłow
ad1fb9f448 player/loadfile: prefer independent track when selecting track
Dependent tracks are supposed to be processed further and not directly
used.

For example, an HEIF tiled image tracks are meant to be stitched into a
full image before being displayed and requires special handling.

Another example would be MPEG-TS audio track tagged with mix_type=0.
Which means that the audio stream is a dependent stream and is intended
to be mixed or combined with a separate complete and independent audio
stream by the receiver.

In either case we should not directly select such tracks.
2024-11-26 11:42:48 +01:00
Kacper Michajłow
81db3446fa DOCS/man/options: mention sub-box/osd-box/box profiles 2024-11-25 17:29:47 +01:00
Guido Cella
86bbe997ce console.lua: don't append spaces after completion
After pressing Tab a space is usually appended after the suggestion, and
with the new autocompletion you have to enter a space again before
seeing the completions for the next token even when there is only 1
matching completion. Just don't append spaces and let the user manually
type 1 space after completion, which is more intuitive.
2024-11-25 16:43:14 +01:00
Guido Cella
8464ba471a console.lua: highlight the first completion in the terminal
Follow up to a0d416e94b.
2024-11-24 13:28:58 +01:00
Guido Cella
e549bf0dec console.lua: update completions after moving the cursor
...and after navigating the history.

I thought of making the new function accept the new cursor position and
set it, but it would not be clear that you're only supposed to call it
when handle_edit() is not already called.
2024-11-24 12:19:45 +01:00
Kacper Michajłow
5730c631fd player/video: update dynamic hdr params 2024-11-24 11:32:12 +01:00
Guido Cella
a0d416e94b console.lua: highlight the first completion suggestion before cycling
2f271a92de made it so that the first completion suggestion is
automatically selected when pressing Enter, if none was manually
selected. So automatically highlight the first completion in yellow to
show this.
2024-11-24 11:23:04 +01:00
Guido Cella
40724f81e1 console.lua: save commands in history after autocompletion
2f271a92de made it so that the first completion suggestion is
automatically selected when pressing enter, but that was done after
saving the command in the history. Save it to the history after
expanding it, so re-running the previous command actually works, e.g.
save "set vo gpu-next" instead of "set vo gn".
2024-11-24 11:23:04 +01:00
Kacper Michajłow
96d2c044fc mp_image: always force RGB formats to full-range RGB
It turns out mpv doesn't tag at all when doing conversions, so we just
re-tag here and hope for the best. This should be improved, but there
are many different code paths when conversion can happen, so for now
revert to previous behavior.

Fixes: 4e5cc9cf1d
2024-11-24 11:22:46 +01:00
Dudemanguy
c089aaafbe wayland: always recalculate scaling if wl->current_output is not set
If we lose the current output for any reason (unplug, turns off, etc.)
and then later it comes back, mpv should always recalculate all the
scaling stuff. The optimization to avoid needless scaling calculations
didn't consider this case and would always exit since the scaling is the
same. So just check wl->current_output's existence as well.

Fixes #15361.
2024-11-24 05:19:09 +00:00
Arcitec
2d813de6b6 DOCS/man/mpv: improve path docs and clarify config-dir path behavior
The previous documentation was pretty scary and misleading, and was
also outdated in several sections.

It was also difficult to understand some of the paragraphs.

The path documentation has now been overhauled to be much easier
to understand and to document the latest mpv behavior.
2024-11-23 22:17:30 +01:00
Guido Cella
200065cc2f options: rename --sub-ass-hinting to --sub-hinting
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00
Guido Cella
d1c2ee1c82 options: rename --sub-ass-shaper to --sub-shaper
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00
Guido Cella
3291254263 options: rename --sub-ass-line-spacing to --sub-line-spacing
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00
Kacper Michajłow
4908a632d3 vo_gpu_next: use display values in target-contrast=auto 2024-11-23 22:16:44 +01:00
Kacper Michajłow
2c2ac3cb36 vo_gpu_next: add target-colorspace-hint=auto 2024-11-23 22:16:44 +01:00
Kacper Michajłow
d53dae1fd6 video/out/gpu/context: add target_csp callback to ra_swapchain
This allows to get target display parameters.
2024-11-23 22:16:44 +01:00
Guido Cella
2f271a92de console.lua: expand the first completion on Enter
If you run a command without manually selecting a completion, select the
first one. e.g. set vo gn runs set vo gpu-next.
2024-11-23 10:48:32 +01:00
Guido Cella
57a6f12ed3 console.lua: dont crash when typing a command prefix
Typing a command prefix crashes console because first_useful_token is
nil. This already happened before implementing autocompletion if you did
no-osd<Tab>, but autocompletion made it evident.
2024-11-23 10:48:32 +01:00
Guido Cella
57b73f1af6 console.lua: show completions as you type
Show available completion suggestions as you type without having to
press Tab.

This is fast even on a 2011 CPU, so we can get away with doing this in
the same thread that draws the console. The one case where it could make
the console hang is file completion of network drives, but in general it
is convenient for loadfile.

mp.input.get clients also get a request to complete on each character
typed, but those run in a different thread so performance is always
fine, and completions were already rejected if the input line or cursor
changed after the request. If I ever make running mpv commands an
mp.input client in the future, command completion will also benefit from
running in a different thread.
2024-11-23 10:48:32 +01:00
Guido Cella
2e265f33e3 console.lua: complete fewer properties
10k properties makes the console hang and the CPU fan spin with live
fuzzy filtering, so print fewer sub-properties. These are rarely useful
anyway.
2024-11-23 10:48:32 +01:00
Guido Cella
a0de894d4c console.lua: determine completions with fuzzy search
For example, set vo gn<Tab> will complete to gpu-next.
2024-11-23 10:48:32 +01:00
Kacper Michajłow
2183f771ef vo_gpu_next: fix mp_image colorspace with some hwdecs
Fixes: ef6052c01e
2024-11-23 10:48:22 +01:00
llyyr
e2a23e08b8 wayland: don't print same message for fractional and wl_surface scale 2024-11-23 04:42:52 +00:00
Kacper Michajłow
3e10309b62 player/loadfile: prefer non-image when selecting video track
This fixes `ytdl_hook`, which would start playback with the thumbnail
track selected. This issue occurs because the thumbnail track is added
first. If the main track is not marked as default afterward, which it
isn't for single streams, the first track (the image track) would be
selected.

In general, if a non-image track is available, it should be preferred.
2024-11-22 21:14:52 +01:00
Jan Ekström
7f49806cf4 ci/lint-commit-msg: move away from things deprecated in Python 3.9
As normal types started being supported better for type hinting,
their alternatives in the typing module would be deprecated.
2024-11-22 21:50:25 +02:00
Jan Ekström
45a72d6bec github/workflows: switch Ubuntu mingw-w64 build to pkgconf
Ubuntu 24.04's pkg-config is already an almost empty transitional
package that depends on pkgconf, and pkgconf contains the
`/usr/bin/pkg-config` binary.

Thus while we are moving macOS to it, we shall do the same with
this mingw-w64 build.
2024-11-22 21:50:25 +02:00
Jan Ekström
1f0ec5cd02 github/workflows: unlink macOS pkg-config if installed
This works around an issue with recent Github CI runners where
Homebrew is in an intermediate state. This is where old pkg-config
is installed, yet pkg-config as a package has become an alias
for pkgconf, thus causing failures to automatically switch symlinks
from one to the other.

Ref: actions/runner-images#10984
2024-11-22 21:50:25 +02:00
Jan Ekström
1bc7e62e9e github/workflows: switch from pkg-config to pkgconf for macOS
Is now available, and pkg-config as a package has been deprecated.
2024-11-22 21:50:25 +02:00
Guido Cella
cf3bc0a722 console.lua: limit the length of selectable items
Giving very long lines to libass freezes mpv and makes the CPU spin
(though it's fine with terminal output). This is often the case
user-data/mpv/ytdl/json-subprocess-result in the property list. So limit
the length of selectable items to 300 characters (not Unicode aware).
This is enough to fill a 1920x1080 window with font_size=16 and Japanese
text.
2024-11-22 19:04:51 +01:00
Guido Cella
5ec569d073 console.lua: strip multiple lines in selectable items
If an item contains newlines, it hides the top items. This is often the
case for sub-ass-extradata and metadata/ytdl_description in the property
list. So keep only the first line.
2024-11-22 19:04:51 +01:00
nanahi
33e297bd8f video/out/wayland_common: initialize offer fd 2024-11-22 11:21:26 +01:00
nanahi
70e02e7b4e video/out/wayland_common: fix dnd with focus follow mouse
Whenever mpv window gains focus, a new data offer is sent for the
selection. However, mpv currently treats it the same as dnd data
offers, which results in wrong handling. One bug which results from
this is when focus follow mouse is enabled, dropping the dnd file
results in the window being focused and selection offer being sent,
freeing the existing dnd offer. This results in dnd being broken
on at least GTK3.

Fix this by separating selection and dnd offer handling. Since there
is no way to know whether an offer introduced by
data_device_handle_data_offer is a selection or dnd offer, make it
pending, and move them once the identity is confirmed.
2024-11-22 11:21:26 +01:00
nanahi
eb0c4b91c1 video/out/wayland_common: extract data offer to a struct
The data offers can be either dnd or selection offers.
Add a separate struct for it so that handling of selection
offers can be added.
2024-11-22 11:21:26 +01:00
norinoriko
68d9ed2572 sub/osd: adjust osd margins 2024-11-21 16:14:07 +01:00
Kacper Michajłow
4b11f66eb1 various: use avcodec_get_supported_config() to resolve deprecation warn
See: 3305767560
2024-11-20 20:42:33 +01:00
Kacper Michajłow
23262308d6 vo_gpu_next: restore initial hook param value
If the parameter is removed from the `glsl-shader-opts` list, it should
be restored to initial value.
2024-11-20 20:41:49 +01:00
Kacper Michajłow
012d317a1e vo_gpu_next: clear renderer cache on options update
This ensures that options are applied to current frame, even in paused
state.
2024-11-20 20:41:49 +01:00
Kacper Michajłow
ef6052c01e vo_gpu_next: remove colospace overrides
Hacks like that has no place here, mp_image should be tagged correctly,
across the player, gpu-next is not special.
2024-11-20 20:40:05 +01:00
Kacper Michajłow
4e5cc9cf1d video/mp_image: fix vf=format colorspace override for XYZ
If format is RGB but flagged as XYZ it should be used instead.
2024-11-20 20:40:05 +01:00
Kacper Michajłow
638ada18f8 etc/builtin.conf: add osd-box/sub-box/box profiles 2024-11-20 20:39:26 +01:00
der richter
45c1c58680 mac/compat: fix compatibility for deployment targets lower than SDK ver
the swift parts can't be nicely encapsulated in the compat file because
it lags proper target version compile time checks.

Fixes #15292
2024-11-18 19:28:35 +01:00
M Stoeckl
46574d479d console.lua,wayland_common: also detect Wayland if WAYLAND_SOCKET set
While most Wayland compositors provide a socket path indicated by
environment variable WAYLAND_DISPLAY, others may sometimes bequeath a
socket file descriptor specified by WAYLAND_SOCKET.
2024-11-18 16:35:57 +00:00
nanahi
998bdef1d0 DOCS/man/input.rst: add sections to categorize commands
mpv has too many commands and they are unorganized in the
documentation, making it difficult to navigate.

This commit completely reorganizes the commands into several
categories to make the documentation easier to navigate.
The following categories are defined:

- Playback Control: Seeking and stepping.
- Property Manipulation: Changing property values.
- Playlist Manipulation: Playlist navigation and editing.
- Track Manipulation: Track navigation and editing.
- Text Manipulation: Text printing, expansion, escaping.
- Configuration: General configuration and related files.
- OSD: Displaying contents as OSD.
- Input and Keybind: Input configuration and key bindings.
- Execution: Execution of mpv and subprocesses.
- Scripting: Script loading and communication.
- Screenshot: Taking screenshots.
- Filter: Changing filters.
- Miscellaneous: Other commands.
2024-11-18 17:28:24 +01:00
nanahi
8d7fff5a2b DOCS/man/input.rst: make event and hooks sections a level higher
They're not related to commands so they shouldn't be a subsection
of list of commands.
2024-11-18 17:28:24 +01:00
Guido Cella
ca38b30de3 DOCS/options: add a Video sync section to group related options 2024-11-18 17:23:08 +01:00
nanahi
9543426889 options: move dvd options to stream_dvdnav
The options and struct are only used in stream_dvdnav.c.
Also use dvd prefix for dvd_conf.
2024-11-18 17:22:02 +01:00
nanahi
354ad7f27d sub/osd_libass: simplify osd bar variable names 2024-11-18 17:22:02 +01:00
nanahi
8612f802dd options: move OSD bar opts to a separate struct
Move them to a suboption so the suboption prefix can be
used.
2024-11-18 17:22:02 +01:00
nanahi
e056ad374f options: move mp_sub_filter_opts to sd_ass.c
Also use sub-filter common prefix.
2024-11-18 17:22:02 +01:00