0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00
Commit Graph

52858 Commits

Author SHA1 Message Date
llyyr
a44a726301 ao_alsa: assume device lost if we couldn't recover after 10 attempts
ALSA API reports -EPIPE even when the the device is lost, which we
currently always assume to be an XRUN. If we assumed XRUN 10 times and
didn't manage to recover, just consider the device lost and try to
reconnect. Allows ao_alsa to recover from alsa server being killed then
reinitialized. And even in the worst case, this should be better than
the status quo of mpv attempting to prepare a PCM device indefinitely
until the user restarts mpv.

This is admittedly not ideal, and I don't think the -EPIPE hack is
necessary anymore, but I can only test on my setup and removing the
'assume -EPIPE is an XRUN' hack might break some setups for whatever
mysterious reasons.
2024-09-14 14:08:30 +02:00
llyyr
44da754018 ao_alsa: don't early exit out of the loop if we have an error
This would cause us to exit out of the loop with a goto anytime we ran
into XRUN or DRAINING and preparing PCM for use failed.
2024-09-14 14:08:30 +02:00
llyyr
ec966fb866 ytdl_hook: add some more yt-dlp tags
These might be useful
2024-09-14 14:07:54 +02:00
Oneric
5357d18fe6 sub: add ass-video-aspect-override option
It is unclear whether there actually is any usecase for this option
which isn't better served by sub-ass-use-video-data and/or LayoutRes
overrides, but prior to the introduction of sub-ass-use-video-data
it was possible to pass along storage resolution while faking an
aspect ratio of 1:1.
sub-ass-video-aspect-override=1 combined with sub-ass-use-video-data=all
now makes this possible again.

The uper limit of a 10:1 aspect matches
the general video-aspect-override option.
2024-09-13 23:24:08 +02:00
Oneric
207b1a2c91 sub: merge vsfilter-aspect and vsfilter-blur-compat options
The naming for "blur-compat" was misleading since the setting
actually affects more than just blur affects. Additionally
forwarding storage resolution but forcing an aspect ratio
of 1.0 for the video is likely to result in odd rendering
and there’s no known usecase for it.

Both options control which video properties are exposed to libass
so to fix the aforementioned issues merge these settings into one
tri-state sub-ass-use-video-data.

The default V keybind now cycles through all states of
use-video-data instead of toggling vsfilter-aspect-compat.

Resolves: https://github.com/mpv-player/mpv/issues/10680
2024-09-13 23:24:08 +02:00
Kacper Michajłow
f6d931301b vf_d3d11vpp: adjust options for userdeint filter
Fixes: #14816
2024-09-08 21:44:51 +02:00
Dudemanguy
e6c536ae45 wayland: fix vertical resizing
Resizing in strictly the vertical direction has been broken forever on
wayland. It's because of how the keepaspect calculation always resized
with respect to the width. So if you moved the mouse strictly
vertically with no change left/right, the mpv window would never change
size since it just calculates with respect to the width that doesn't
change.

Fixing this is kind of weird and maybe someone should think of a better
algorithm for preserving aspect ratio (we just multiply by the gcd
basically), but whatever. You might naively try something like "resize
with respect to what direction changes the most" at first, but this
leads to very cludgy resizing since during a typical mouse dragging
motion, it will flip constantly from "resize w/ respect to the width"
and "resize w/ respect to the height". It "works" but it's really ugly
and not worth it.

The trick is to realize that we need to consider the resizing state as
one continuous motion, choose a direction initially, stick to it
throughout the entirety of the resize, and reset the relevant parameters
after we finish the resize. This ensures the direction never
unintuitively flips during a motion, but also allows for the strictly
vertical case to still work.

Might as well note it here in the commit, but mpv's resizing behavior
technically violates xdg-shell. For the resizing event, "[t]he window
geometry specified in the configure event is a maximum; the client
cannot resize beyond it." Well, we do obviously go beyond the maximum in
certain cases. For example consider resizing strictly horizontally. The
width value increases from the compositor but not the height. Since mpv
preserves aspect ratio by default, the height obviously must increase
which will go over the prescribed bounds by the compositor. This happens
before and after this commit, and I think everyone agrees is the desired
behavior. With this commit, now vertical resizing works which violates
xdg-shell in the same way. Before, it incidentally obeyed the protocol
since it did not resize at all, but let's presume users expect the
window to actually get bigger when they do a drag resize.

*: https://wayland.app/protocols/xdg-shell#xdg_toplevel:enum:state:entry:resizing
2024-09-08 18:36:17 +00:00
Kacper Michajłow
5edc8973eb various: use talloc_replace 2024-09-08 17:33:27 +02:00
Kacper Michajłow
3edbd30798 ta_utils: add talloc_replace
Helper to replace a string with a new one without reallocating the
buffer, if not needed.
2024-09-08 17:33:27 +02:00
Kacper Michajłow
077f05f7a1 ta_talloc: remove non-existent function prototype 2024-09-08 17:33:27 +02:00
Kacper Michajłow
e7f153db58 stats.lua: don't use ASS tags when use_ass is false
Fixes terminal output.
2024-09-08 17:33:03 +02:00
nanahi
f92d5da89c player/main: uninit input after terminal uninit
The terminal input thread holds the input_ctx reference.
Fixes: c1282d4d43
2024-09-08 17:14:37 +02:00
nanahi
e169302e2d video/out/wayland_common: set key state only on keyboard_enter keys
These keys should be considered "being pressed" instead of an action of
press. This way, the keypress action won't be triggered; it now triggers
only when the key binding is repeatable and after the initial ar delay.
2024-09-07 18:14:56 +00:00
nanahi
c4ff675198 input: add MP_KEY_STATE_SET_ONLY
Trivial.
2024-09-07 18:14:56 +00:00
nanahi
4295141703 input/keycodes: fix typo 2024-09-07 18:14:56 +00:00
Kacper Michajłow
0eb5e914d9 ci/win32: add dav1d 2024-09-05 16:29:16 +02:00
nanahi
f02b8bc9fd stats.lua: fix text size/alignment for key bindings page
After a subject line, the text style needs to be reset to make
sure that key binding lines have correct size and alignment
while scrolling the page.
2024-09-05 14:06:05 +02:00
norinoriko
ecc6cddef0 DOCS/man/options: update defaults for --hwdec-codecs
`prores` was added to the whitelist in 629b637406.
2024-09-04 18:46:30 -04:00
bodayw
db19dbca5c DOCS/man/options: fix deinterlacing typo 2024-09-04 16:27:53 +02:00
Kacper Michajłow
ad7976c33e input: fix use of bstr like null terminated one
It has been changed in one of the iterations of the patch during review,
but bstr doesn't have to be null terminated. Fix it by adding dedicated
node_map helper.

Fixes: 1a27f3c
2024-09-04 03:52:09 +02:00
Kacper Michajłow
1ecfb29932 osdep/io: redefine off_t for Windows build
off_t is long (4 bytes) on Windows, regardless of _FILE_OFFSET_BITS,
which is not supported there.

Fixes: #14790
2024-09-04 03:51:56 +02:00
llyyr
a0ebfc3462 sub: remove dead code 2024-09-03 18:31:38 +02:00
llyyr
c02aa154ab vo_gpu: restore dovi mapping directly on image_params after init 2024-09-03 17:08:28 +02:00
llyyr
3acd253e89 mp_image: don't restore image params if they're unknown 2024-09-03 17:08:28 +02:00
llyyr
fe4ba71962 etc/mpv.conf: update stale comment about mpv config location
We don't support reading mpv.conf without a mpv parent directory anymore
(did we ever?).
2024-09-02 13:51:00 -04:00
Kacper Michajłow
1f33889c03 vo_libmpv: use fallback colorspace for Dolby Vision
Same as 2a72e6cb20 for libmpv.
2024-09-02 04:14:56 +02:00
norinoriko
afdbbac81d input.conf: swap the positions of values for ctrl+h binding
Allows users to toggle software decoding with a single action if they
are using a value for `hwdec` that is different from `auto-safe`.
2024-09-01 19:42:15 +02:00
Kacper Michajłow
c2997aa7de vf_d3d11vpp: add output format selection 2024-09-01 19:41:41 +02:00
nanahi
c4d85fc0c4 vf_format: restore image params before dovi mapping 2024-09-01 19:41:25 +02:00
nanahi
2a72e6cb20 vo_gpu: use fallback colorspace for Dolby Vision 2024-09-01 19:41:25 +02:00
nanahi
14d3a8ed28 mp_image: save fallback colorspace when dovi metadata is present
Since d9c1e9bc5c dovi metadata is
unconditionally mapped to colorspace in mp_image.

However, Dolby Vision videos can have backwards compatibility present for
players without the ability to interpret dovi metadata, like all current
VOs other than gpu-next. In this case, the original video colorspace should
be used to make sure backwards compatibility work properly.

Save the fallback colorspace for VOs which don't interpret dovi metadata.

Fixes: d9c1e9bc5c
2024-09-01 19:41:25 +02:00
Kacper Michajłow
d6eb85bb1a ci/linux: disable leak detector temporarily
After libass update our jobs started failing. It has been fixed upstream
already, but we need to wait for next stable release to have that.

See: 6e83137cdb
2024-09-01 19:27:51 +02:00
Guido Cella
7c672e33a5 command: expand ~ paths in load-config-file
Fixes #14766.
2024-08-30 18:54:37 +02:00
nanahi
c890635634 video/out/gpu/video: use video rectangle for video-target-params
This makes the reported sizes the same as how stats.lua calculates
sizes for VOs witout video-target-params while in dumb mode.
2024-08-30 00:34:05 +02:00
nanahi
e8d14cd314 video/out/wayland_common: don't pass mouse inputs on resizing edges
Since a6683ea3c9 it is possible to bind
MBTN_LEFT to something useful without conflicting with VO dragging.
However, currently wayland edge resizing is an exception and trying to
resize still triggers MBTN_LEFT. This is not a problem on win32 which
does not pass these inputs to the input system.

Fix this on wayland to do the same.
2024-08-28 03:30:46 +02:00
Kacper Michajłow
938938a985 fuzzer_options_parser: add options parser fuzzing
To improve coverage of parse_commandline.c
2024-08-27 01:31:40 +02:00
Kacper Michajłow
7398e755d1 DOCS/vf: update obsolete note hwdec in d3d11vpp
mpv has ability to upload frames.
2024-08-27 01:27:48 +02:00
Kacper Michajłow
47cb503bf5 f_hwtransfer: fix best upload format selection
It is possible for a format to be supported by hardware but not by
av_hwframe_transfer for uploading. This breaks the best upload format
selection. We first select the hardware input format and then choose the
best software format that can be uploaded. In some cases, this may
result in a format that is not uploadable at all, leading to an error.
To solve this, we should avoid adding non-uploadable formats to the fmts
table.

For example, for format d3d11/yuv420p, av_hwframe_transfer_get_formats()
returns empty list of formats.
2024-08-27 01:27:48 +02:00
Kacper Michajłow
bb0a852f56 vf_d3d11vpp: skip conversion mode selection if not requested 2024-08-27 01:27:48 +02:00
Kacper Michajłow
1c34b72aeb vf_d3d11vpp: don't force nv12 output 2024-08-27 01:27:48 +02:00
Kacper Michajłow
a341b128de vf_d3d11vpp: alloc output frames through AVHWFramesContext
This fixes d3d11 frame download further in filtering chain.

Fixes: #14732
2024-08-27 01:27:48 +02:00
Kacper Michajłow
421df7564a vulkan/context_display: don't fake avalibity of callbacks
There are generic fallback paths for those and it shouldn't be replaced
by noop.
2024-08-27 01:27:39 +02:00
llyyr
cb4fdb530a video/csputils: remove space from choice option for chroma loc
Also document the field
2024-08-24 17:11:39 +02:00
llyyr
488c636a71 DOCS/man/vf: don't document removed vf_format field
This field was removed in c6b9288465

Reported-by: burgerga
2024-08-24 17:11:39 +02:00
Guido Cella
64a0e31aa9 console.lua: pre-filter searched commands if the line is filled
If you type something before pressing Ctrl+r, filter the commands
containing the typed line.

fuzzy_find() is modified to not code a separate case when the line is
empty in both handle_edit() or search_history().
2024-08-24 03:14:04 +02:00
llyyr
92f052c14e playlist: fix setting current item with autocreate-playlist
when the current directory isn't the playlist directory.
2024-08-23 00:56:17 +02:00
Kacper Michajłow
b6f0599bfd demux_mkv: fix av_parser_codec leak 2024-08-22 18:13:53 +02:00
verygoodlee
e3a9ce22f9 console.lua: add numpad + - * / keybindings
numpad + - * / was remapped to KP_ADD/KP_SUBTRACT/KP_MULTIPLY/KP_DIVIDE in #14660
2024-08-21 14:31:01 +02:00
Kacper Michajłow
f44c29b223 vf_d3d11vpp: ensure width and height is even
Fixes: bbb3d5ba78
2024-08-20 20:27:03 +02:00
Kacper Michajłow
2848af5618 vf_d3d11vpp: add support for Intel VSR and NVIDIA RTX scaling modes
Adds `--vf=d3d11vpp=scaling-mode` to control which extensions should be
enabled.

Fixes: #11390
Co-authored-by: xc <wxc9312@gmail.com>
2024-08-20 03:34:08 +02:00