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

51460 Commits

Author SHA1 Message Date
llyyr
02533e5928 wayland: don't ignore key modifiers if they were consumed
According to the xkbcommon docs, `xkb_state_mod_index_is_consumed` is
true when a modifier *may affect* key translation. A key modifier may
be consumed but not be active. See xkb documentation for this function
for further details. This breaks key modifiers in cases where
L_Shift+R_Shift for example is used to change keyboard layout with
`xkb_options grp:shifts_toggle`. Instead, replace it with a simple
check for a valid modifier.
2024-01-13 17:10:52 +00:00
Guido Cella
43ac656b02 DOCS/mpv: the playback position is not remembered after poweroff
This doesn't actually work on either Windows or Linux with --terminal.
With --no-terminal or --no-input-terminal the SIGTERM handler is never
registered, so it definitely can't work.

Just remove the note about signals because it would be complicated to
explain that they don't terminate abruptly only with --terminal and only
if that signal has a handler, and it wouldn't be of interest to most
users.
2024-01-13 10:45:35 +01:00
Dudemanguy
2ad96079e9 player: add forced choice to subs-with-matching-audio
fe875083b3 confused things a bit and made
--no-subs-with-matching-audio actually mean what it says: no subtitles
if the languages match. However, the option actually meant no non-forced
subtitles not no subtitles at all. This isn't really intuitive so
instead of changing the behavior back to the old way (we already have a
release since then), add a third option "forced" which is equivalent to
the old meaning of --no-subs-with-matching audio. Fixes #13151.
2024-01-13 03:26:06 +00:00
Guido Cella
871f7a152a scripting: add mp.input
This lets scripts get textual input from the user using console.lua.
2024-01-13 02:53:08 +00:00
Dudemanguy
2dd3951a9c filter_sdh: fix incorrect placement of null terminator
The +1 here is not correct. For a 4-byte unicode character, this would
throw a runtime error because the +1 would try to assign the null
terminator past the actual bound of our array. Just remove it since it
should be exactly equal to whatever we have for bytes.
2024-01-12 20:46:00 -06:00
Dudemanguy
e15b2b19a3 filter_sdh: sanitize get_char_bytes heuristic to avoid overflow
There's a simple check in filter_sdh that gets the bytes of the first
character in a string in order to do pointer arthimetic to filter the
string. The problem is that it is possible for the amount of bytes to be
greater than the actual length of the string for certain unicode
characters. This can't be worked with so enforce the strlen as the
absolute minimum here to avoid overflow situations.

Fixes #13237.
2024-01-12 20:45:40 -06:00
sfan5
431b420dd6 ao_null: fix reset() implementation
Stopping output implies that it can't be paused anymore.
This is consistent with the documented API in internal.h as well
as the behavior of other AOs.

resolves #13267
2024-01-12 20:36:04 +01:00
llyyr
d56ad8f032 github/workflows: don't install angleproject on msys2
This package isn't available for i686 anymore, and not worth the hassle
to only install it for win64 since it isn't particularly useful.

See: fff2fa3711
2024-01-12 17:19:25 +01:00
llyyr
bd5d8e41ac demux_lavf: remove fix_editlists hack for mp4
Remove this "hack" from 2017 which disabled `advanced_editlist` while
demuxing mov/mp4. See: b7b12c36af as well
as b86a2316df

At present, advanced edit list support seems to be mature enough that it
doesn't need to be disabled by us and disabling it seems to break more
files based on testing with `elist` files in FFmpeg's FATE suite.
2024-01-11 08:44:18 +01:00
llyyr
10321b869f f_lavfi: provide color_space and color_range params for lavfi
Only when the lavfi version is sufficiently new enough to actually have
these fields. See:
2d555dc82d

Fixes #13234
2024-01-11 07:05:35 +01:00
nanahi
4b69164147 x11_common: prefer Xft.dpi for HiDPI scaling
Xft.dpi is much more widely used nowadays by GUI programs compared to
the X11 screen DPI.
This is the best we can get for a vendor-neutral scaling preference
value under X11 in terms of adoption.
If Xft.dpi isn't available, the X11 screen DPI is used as a fallback.
2024-01-10 00:33:05 +01:00
nanahi
a504e696c8 x11_common: allow DPI scale in unit of 0.5
~144 DPI displays are pretty common and neither 1x nor 2x scales are
the right size for it. Allow DPI scale in unit of 0.5 to fix this.

Additionally, add a note about the current behavior of the API used
to get the scale factor.
2024-01-10 00:33:05 +01:00
Kacper Michajłow
485221ba22 msg: return zero length if bstr_split_utf8 fails
In theory bstr_split_utf8 should skip invalid sequence and move further,
but it doesn't do that currently, so just the string if unsuported code if
found.

Fixes infinite loop on code.len == 0 condition.

Fixes: 5864b72d1a
2024-01-10 00:31:57 +01:00
nanahi
41259db952 vo_gpu_next: respect d3d11 swapchain output format preference
Currently, libplacebo always tries to reconfigure the d3d11 swapchain
to a 10-bit output format because disable_10bit_sdr isn't set to true,
even when an 8-bit format is explicitly requested via
--d3d11-output-format.

Fix this by passing the requested output format preference to libplacebo.
Document that this option may be ignored.
2024-01-06 23:46:12 +01:00
nanahi
f0bcbdcf76 README: specify the meaning of "not too ancient Linux"
Commits like 3b19866882 show that in
practice, only the lastest releases of popular distributions are
supported.
2024-01-06 21:33:30 +01:00
nanahi
5aae6bbf4e README: recommend --profile=fast for crappy GPUs
0.37.0 uses more computationally expensive shaders by default,
which can cause high GPU usage and frame drops even for modern
integrated GPUs, especially with 4K and high fps contents.
Recommend --profile=fast for them.
2024-01-06 21:33:30 +01:00
Dudemanguy
d8c2e33a5d DOCS/options: note that --geometry doesn't fully work on wayland
Positioning windows won't work on wayland so note it here to hopefully
avoid confusing users.
2024-01-04 14:47:06 -06:00
Guido Cella
448cb4d13d console.lua: expand ~/ in file completion
Makes Tab expand loadfile ~/ to loadfile /home/$USER/.

I used expand-path instead of os.getenv('HOME') to make it work on
Windows.
2024-01-04 13:41:15 +00:00
Kacper Michajłow
5864b72d1a msg: improve term_disp_width to support unicode
All characters are assumed to be single-width. This is consistent with
the rest of the code and documentation.

Fixes: #13150
2024-01-04 13:41:06 +00:00
Kacper Michajłow
687372e2a2 ci/build-freebsd: use march=native for QEMU hosted build
This is workaround to not emit instructions that are broken with current
version of QEMU used in CI job.

Fixes SIGBUS on valid code when executed in QEMU caused by issue with
CVTPS2PD instruction.

QEMU issue:
https://gitlab.com/qemu-project/qemu/-/issues/1377

QEMU fix:
abd41884c5

Should be resolved after QEMU update to 8.2.0:
https://github.com/cross-platform-actions/action/issues/78
2024-01-04 11:44:22 +01:00
Kacper Michajłow
6e5fd52dde player/video: set video_out to NULL before broadcasting events
This avoids possible reference of video_out after destory.
2024-01-04 11:44:22 +01:00
Guido Cella
ab5b250343 command: allow changing --gpu-api and --gpu-context at runtime 2024-01-01 22:41:49 +01:00
Guido Cella
7521b65d92 DOCS/ao: change wrong note on which driver is preferred
--ao=pipewire has been preferred on Linux for a long time, and this note
even makes it sound like alsa is preferred on any system. Just say that
the print order is the order in which the drivers are tried so this note
won't have to be updated again in the future, like --gpu-context's
documentation does.
2024-01-01 22:41:38 +01:00
Guido Cella
28b21e4ab7 console.lua: hide the cursor when unfocused
This is commonly done to understand whether a window is focused. This
explicitly checks if focused is false instead of unavailable to not
break the cursor where focused is unimplemented like on --vo=drm.

The cursor is taller than the input text so it is made transparent
instead of completely removing it so that the log doesn't move up and
down while toggling focus. Alternatively, cheight = opts.font_size * 8
can be changed to 7.
2024-01-01 14:24:00 +01:00
Guido Cella
731378d1bb console.lua: don't reinsert completion_append after cycling
43ed0a83d0 avoided reinserting the string that is appended after certain
completions when it is already after the cursor when inserting the
longest common prefix of the suggestions. Do the same when cycling
through them.
2024-01-01 14:23:40 +01:00
nanahi
abc2a7484d DOCS/man: remove "Linux desktop issues" section
This section has no reason to exist anymore because:

- No "desktop issues" sections exist for other platforms, and all other
Linux-specific issues are represented as notes for options. This section
only addressed one specific issue.

- This section was shortened significantly with commit
2c46ae8ea3, so there is no need for
this to be a separate section anymore.

- This section was shortened again with commit
d5e681e95d, when the original rationale
behind this section became outdated because GNOME has implemented the
idle inhibit protocol.

The historical info is moved to the documentation of --stop-screensaver.
2023-12-29 19:29:35 +00:00
Guido Cella
a16bad4004 vo_sdl: support the focused property 2023-12-29 11:31:18 +01:00
nanahi
3bf8564a4f DOCS/man: use the correct directive type for "Warning" admonitions
Some places in the manpage uses `.. admonition:: Warning` instead of
the specific directive type  `.. warning::` for warning admonitions.
This causes the "Warning" text appearing in black color instead of red.
Correct them here.
2023-12-28 21:54:09 +01:00
nanahi
26df531b14 win32: add support for --input-cursor-passthrough option
This completes the support for all supported desktop platforms.
2023-12-28 15:45:24 +00:00
nanahi
579349b21c screenshot: remove artificial limit on the number of screenshots taken
This allows taking more than 99999 screenshots in a single session,
and also for the case when a sequence of 99999 screenshots
already exists on the filesystem.
2023-12-28 15:45:08 +00:00
nanahi
cdbc1ceb70 DOCS/options: fix documentation for --force-window window size
The value has been wrong since ca2b05c0fb,
and recent commit 8b4a995a9d still didn't
fix it.
2023-12-28 13:12:38 +01:00
sfan5
9565675488 various: use correct PATH_MAX for win32
In commit c09245cdf2
long-path support was enabled for mpv without actually
making sure that there was no code left that used the
old limit (260 Unicode chars) for buffer sizes.
This commit fixes all but one case.
2023-12-27 22:55:56 +01:00
sfan5
f57ec94d9f osdep: clarify and rename a constant on win32
This is about the maximum filename not path length.
2023-12-27 22:55:56 +01:00
Ikko Eltociear Ashimine
dd48a53b65 various: fix capitalization of 'GitHub' 2023-12-27 22:11:58 +01:00
Kacper Michajłow
1306ea9854 msg: reduce nesting in mp_msg_flush_status_line
Cosmetic change only.
2023-12-27 20:59:22 +00:00
Kacper Michajłow
cadb68487e msg: keep status line on the end of file
Apparently found useful by some users.

Fixes: #13092
2023-12-27 20:59:22 +00:00
Guido Cella
19a37f625f console.lua: refactor find_common_prefix
Reuse common_prefix_length() to make find_common_prefix() shorter and
faster by not creating many temporary strings.

The decrease in the average time to run find_common_prefix() over 1000
calls I measured is:

set \<Tab>: 1e-4s -> 1e-5s
set s\Tab>: 1e-5s -> 5e-6s
2023-12-26 20:12:24 +01:00
der richter
4d7763e6a6 mac: add support for --input-cursor-passthrough option 2023-12-25 13:59:48 +01:00
Guido Cella
dde2776655 DOCS/options: fix --image-display-duration's documentation
- --image-display-duration does not hide the OSC.
- Saying "Setting --image-display-duration" makes no sense because it is
  not a boolean and it cannot be unset.
2023-12-25 09:46:34 +01:00
JohhanSam
68eaaf0da3 DOCS/interface-changes: add --secondary-sub-ass-override
Option added in b563b2ae
2023-12-24 13:09:13 +01:00
Kacper Michajłow
a44f0e574d common/av_log: do not assume AVClass.item_name is always set
After recent change in FFmpeg it is not longer safe to call item_name.

Ref: 0c6203c97a
2023-12-24 12:50:24 +01:00
der richter
0d47e48437 mac: add support for --auto-window-resize option
Fixes #9325
2023-12-23 01:15:53 +01:00
der richter
fa4ca16f66 mac: update geometry/autofit opts on runtime 2023-12-23 01:15:53 +01:00
Andarwinux
e832f4969f win32: opt in to the windows segment heap
ref: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#heaptype

Improves demuxer cache recycling speed at the cost of a slight CPU usage increase.
SegmentHeap is supported in Windows 10, version 2004 (build 19041) and later.
2023-12-22 16:36:31 +01:00
stax76
c09245cdf2 win32: support long file paths 2023-12-21 17:40:45 +01:00
Dudemanguy
069143252a osc: allow disabling special mouse wheel behavior
When hovering certain elements over the OSC, using the mouse wheel can
result in special commands (such as seeking, changing audio tracks,
etc.) Not everyone neccessarily wants this feature, so add an option to
make it possible to disable all of it. Maybe more fine-tuned control
would be more ideal, but probably not worth it. Fixes #13096.
2023-12-21 09:13:11 +01:00
Guido Cella
17be6e1990 terminal-unix: enable the cursor after ctrl+z
24270b8587 disabled the cursor while mpv is running, but if you send mpv
to the background, it is not re-enabled until you run bg, and not even
after that if mpv is paused. Fix this by enabling the cursor from the
SIGTSTP handler.
2023-12-18 15:03:40 +00:00
dyphire
b563b2aed0 options: add --secondary-sub-ass-override
Default: strip. preserve the old behavior
2023-12-18 14:58:34 +00:00
Guido Cella
702b3eb956 lua: don't return a second value from successful format_json
Even for successful calls, utils.format_json returns nil as the second
return value. This doesn't have any purpose and is not documented, and
it is inconvenient for passing JSON to script-message, because

mp.commandv('script-message', 'foo', utils.format_json(...))

errors because mp.commandv receives nil as the fourth argument.

This commit makes format_json return only one value in case of success
to fix this.
2023-12-17 18:38:33 +01:00
sfan5
00942d56ba command: support passing scale to keypress 2023-12-17 18:36:16 +01:00