strlen is only relevant if the length is less than [1, 4], so this can
be replaced with strnlen instead which will only traverse characters
upto the maxlen insted of the entire string length. It also makes MPMIN
unneeded. Also fix a comment.
commit fa9e1f06f tried to move signal unsafe operations out of
signal handlers but mistakenly introduced a race. before,
sigtstop would process the following in order:
0. do_deactivate_getch2();
1. raise(SIGTSTP)
that commit moved 0 out of the signal handler (due to it being
unsafe) but kept 1 in there. this may mess up the ordering of
these operations. this commit moves everything out of the
handler so that things happen in proper order.
since things are now moved out of the handler, SA_RESETHAND is
no longer being applied to SIGTSTP. since that can result in
races if multiple signals are delivered faster than we can
respond to them.
When running the console in the terminal, style log lines with the same
escape sequences as msg.c.
mp.input can also specify terminal escape sequences, e.g. a script to
select a playlist entry can invert the color of the selection.
Also add a missing newline to help's error message.
This can cause mpv to abruptly quit without following the proper uninit
process when a second `SIGTERM` or `SIGQUIT` is sent and mpv
didn't quit on the first one already. This is because the default action
for these signals is to terminate the program immediately, similar to
`SIGKILL`, and `SA_RESETHAND` resets the `quit_request_sighandler` to
`SIG_DFL` for the default action.
Also keep the `SA_RESETHAND` flag for SIGINT because the current
behavior is to quit after receiving two Ctrl+C no matter what, this is
probably convenient and worth keeping.
This change is because some tools (e.g. GNU timeout) send SIGTERM twice
after the timeout period.
An easy way to reproduce is with `timeout 1 mpv [...]` where mpv would
quit abruptly anywhere from half the time to once every 50 attempts
depending on your luck.
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.
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.
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.
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.
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.
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
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
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.
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.
~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.
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
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.
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.
--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.
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.
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.
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.
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.
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.
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.
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
- --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.