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

51580 Commits

Author SHA1 Message Date
Mohammad AlSaleh
a1bda5b34d sub: allow setting lavc txt_page special values via teletext_page
* Range of accepted values for teletext_page now include 0 and -1.
 * 0 means "subtitle" and -1 means "*".
 * Make 0 the default.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-02-13 10:44:41 +01:00
sfan5
09606b9db9 ci/mingw: pin Vulkan version again
With 1.3.277 the AV1 decode headers have been upstreamed.
These get preferred over ffmpeg's internal non-standard header
for this extension (same name). FFmpeg currently only builds
using its own header and a patch to work with upstream ones
is in review.

For now pin vulkan at the version before that to unbreak our CI.
2024-02-12 14:42:29 +01:00
sfan5
4981690fb6 x11_common: fix Xft.dpi detection ignoring --hidpi-window-scale
closes #13466
fixes: 4b69164147
2024-02-12 13:51:25 +01:00
sfan5
cbcf12cdbd README: mention libplacebo subproject integration 2024-02-12 11:04:22 +01:00
llyyr
a85efa64f0 meson: set default options for libplacebo if using subproject
This will prevent building demos and link statically with libplacebo by
default if system libplacebo is not found or isn't new enough and a
sufficiently new enough libplacebo exists in `subprojects/libplacebo`.
2024-02-12 11:04:22 +01:00
sfan5
ca5f7d2b4b osdep: fix infinite loop when cancelling subprocess
Due to the state of the other fds/pipes it cannot safely be assumed
that the loop breaks on its own.
2024-02-11 14:13:22 +01:00
nanahi
71598ca07e various: replace dead links in comments
Replace various dead links with live replacements or archives.
Less friction for anyone who wants to look up these references.
2024-02-11 04:01:24 +00:00
Guido Cella
86e0882733 wayland: don't press keys again when releasing modifiers
Since 1f8013ff3f, if you release a modifier before a regular key on
Wayland, that key gets immediately pressed again because
keyboard_handle_modifiers() calls mp_input_put_key() regardless of
whether a modifier is pressed or released, e.g. if you press Ctrl+s it
easy to take an another screenshot with s by accident. Fix this by
releasing keys when releasing modifiers.

Ideally, releasing the modifier should input the key alone after
--input-ar-delay, while this patch disables it forever, e.g. on X11 if
you type something in the console, hold Ctrl+h, and release Ctrl, it
starts typing h instead of deleting characters. This doesn't work
because keyboard_handle_key() is only called when you first press a key,
while on X11 KeyPress keeps getting sent as you hold down the key. But
this difference in behavior between X11 and Wayland can also be
reproduced with GTK and Qt applications, so I guess this is acceptable.
2024-02-11 04:01:14 +00:00
Guido Cella
a039cfce00 demux: clarify the meaning of still_image
Clarify that ffmpeg sets AV_DISPOSITION_STILL_IMAGE for sparse videos
like https://s3.amazonaws.com/tmm1/music-choice.ts, not for images.
2024-02-11 04:01:04 +00:00
Philip Langdale
f5c4f0b0f4 hwdec_drmprime: check for AV_PIX_FMT_P210 before using it
This isn't present in older ffmpeg releases.

Fixes #13454
2024-02-10 13:29:04 -08:00
1nsane000
6c65537c90 demux_mkv: add tags for A_MPEG/L1(mp1) audio 2024-02-10 12:38:59 +01:00
Avi Halachmi (:avih)
d70c77b6b6 js: complex key-binding: send also key_text
This is doumented and has been part of the table in lua, but until
now not in the JS object.

Fixes #13448
2024-02-09 16:54:57 +02:00
Dudemanguy
a45518cf57 wayland: set current_output on surface leave if applicable
When the mpv surface leaves the output, we no longer mark it as the
current output. However, this implicitly depends on there being a
preceding surface entrance event to a different output. This is not
necessarily the case. Consider moving the window from monitor 1, to
monitor 1-2, and then back to 1 again. mpv gets the entrance event to
monitor 2 and sets that as the current output to work off of. Then when
you move back to only monitor 1, it removes monitor 2 from the current
output. However, monitor 1 is not updated again as the current output
because there is not a new surface entrance event in this case (the
window never left). So the numbers that mpv's core is using are
incorrect and for the wrong monitor. Luckily, we already keep track of
what outputs the mpv surface is currently on no matter how many there
are so it is simply a matter of setting current output again in the
leave event if we have a different output that has the mpv surface.

Ref: https://github.com/swaywm/sway/issues/7932
2024-02-08 22:26:15 +00:00
Kacper Michajłow
399a96db5b demux_mkv: set only image flag and ignore still_image
Also check if stream is already image to avoid probing.
2024-02-08 22:21:08 +00:00
Kacper Michajłow
9254231175 demux_mkv: increase probing size for still image
Some files, especially with quite a few audio tracks have video blocks
further away, which made them false detected as still images.

Fixes: 26a5146
2024-02-08 22:21:08 +00:00
Dudemanguy
df720b5218 sd_lavc: support secondary subs properly
Before 3250f6e447, secondary subtitles
didn't work properly with sd_lavc at all. They would render but be in
the same position as the primary subtitles. sd_ass used SD_CTRL_SET_TOP
to specifically place secondary subtitles in a different spot, but it
was unused by sd_lavc. With that above mentioned commit, it became
possible to distinguish between the position of primary and secondary
subtitles via mpv's option system. sd_lavc was missed however because at
the time we simply didn't realize this could work and was actually
simple. With some subsequent refactoring that happened later, the fix is
to just use the correct sd->order when accessing the shared subtitle
options instead of hard coding 0. Fixes #13440.
2024-02-08 11:43:24 -06:00
Guido Cella
36153d1a4a console.lua: move functions to strip common characters
Move common_prefix_length() and related functions before the first call
to common_prefix_length(). It works now because it's global but if we
ever make all functions local for consistency it will stop working.
2024-02-08 18:18:33 +01:00
nanahi
aa100d1512 f_output_chain: prevent double free of child filters
When mp_output_chain_update_filters() fails, talloc_free() is called on
each mp_user_filter. But because the structure doesn't have a talloc
destructor, the args aren't freed, resulting in stale references.

Fix this by calling the destructor of the wrapped filter instead.
2024-02-08 18:16:21 +01:00
Dudemanguy
fd2c5ee21d stats.lua: use deinterlace-active property instead
But still read the deinterlacing option to distinguish between yes and
auto.
2024-02-07 14:50:09 +00:00
Dudemanguy
003fb15cbb player/command: add deinterlace-active property 2024-02-07 14:50:09 +00:00
Dudemanguy
8dbbc2ad82 player: add an auto option to deinterlace
Deinterlacing required that the user set it on/off themselves, but we
actually have handy flags for detecting if a frame is interlaced. So
it's pretty simple to make an auto option using that. Unfortunately,
life is not quite that simple and there are known cases of false
positives from the ffmpeg flags so we can't make auto the default value.
However, it still may have some utility for some people, and the
detection could potentially be improved upon later. Closes #10358.
2024-02-07 14:50:09 +00:00
Kacper Michajłow
9ce2bafbe9 vo_vdpau: cosmetic changes to timings
Remove unneded range check.
Print time difference with more precision.
Use the same data formats for fps and interval as in other VOs.
2024-02-07 14:45:07 +00:00
Kacper Michajłow
5d8faff9bf ao_sndio: add missing config.h include 2024-02-07 14:44:52 +00:00
nanahi
29c250c8d8 github/workflows: ignore more files from build workflow
Exclude more files not participating in the build process,
including README.md, to achieve the original goal of preventing
artifacts comment spam.
2024-02-07 14:44:01 +00:00
Guido Cella
b8c6070f01 demux_mf: detect webp
This lets you play mf://*.webp. It is not necessary to play webp
normally because they are already detected by demux_lavf.
2024-02-06 18:08:53 +01:00
Guido Cella
addf4ad023 Revert "demux: put type2format into codec_tags with helper functions"
This reverts commit be0a979a0b.

The list of images codecs is no longer used by demux_mkv.c because
26a51464b6 made it check the number of blocks instead to not misdetect
animations in image codecs, so move it back to demux_mf.c since it is
its only user, so it is easier to understand how it is used, keeping the
jxl addition from e9d0a31dfe.
2024-02-06 18:08:53 +01:00
Dudemanguy
343a5fd345 player: remove all rpi-specific code
vo_rpi and its related code has pretty much historically been a
disaster in mpv. The build regularly gets broken and since nobody uses
it, it takes months for anyone to notice. There was also that time where
fullscreen was broken for about a year and a half. Also building in waf
was entirely broken for about a couple of years or so due to mysterious
reasons no one ever figured out (meson magically fixed it).

Anyways, once again the build is broken due to rpi being forgotten about
again, but instead of pretending to support this crap. Just drop it all.
Nowadays, mmal hwdec is a relic since these devices are better off using
the v4l2m2m ffmpeg fork instead which actually uses KMS properly. RPI 1
and 2 probably can't do this and will remain broken but oh well blame
Broadcom for being special snowflakes and not using standard APIs (my
rockpro worked out of the box; just saying). RPI 2 is nearly 10 years
old anyways, so I think you can afford a new SBC by now. If we were
nicer, there would be a deprecation period, but this is broken in the
last major release anyway so too late.

Closes #13402.
2024-02-05 17:41:06 +00:00
Thomas Weißschuh
8ecb462a9c audio: rename ao_read_data_unlocked
As mentioned in [0] the suffix "_locked" would have been the appropriate
naming in line with similar uses inside mpv.
See `mp_abort_recheck_locked()`, `mp_abort_trigger_locked()`,
`retrigger_locked()`, `wakeup_locked()`...

[0] https://github.com/mpv-player/mpv/pull/12811#discussion_r1477518525
2024-02-05 09:25:48 -08:00
Dudemanguy
531868fe0d player: ensure runtime updates of certain rendering options
When adding things like brightness or gamma, the video obviously needs a
redraw if paused. This happened to work in the normal case because the
OSD notification triggered a redraw, but if you use no-osd the picture
won't change. Fix this by adding another option flag, UPDATE_VIDEO, and
simply signalling we want a redraw. This gets handled along with the
normal osd redrawing check in the playloop so something like "no-osd add
gamma 1" actually works.
2024-02-05 17:23:47 +00:00
Kacper Michajłow
7616190aa4 github/workflows: revert to github-script@v6
There is an upstream regression in v7. Use v6 until Node 16 is still
available.

See: https://github.com/actions/github-script/issues/448
2024-02-05 11:13:18 +01:00
Dan Oscarsson
b23e8b2ffb vo_vdpau: fix timing for nanoseconds
df764bc0c3 and
c82c55b4b9 blindly converted the units for
this VO since neither of us actually have the hardware/setup to test the
VO. Well it was not actually correct (maybe just one was wrong or both
who knows) since vo_vdpau using timing very differently than all the
other VOs and no one reported on it until just now. Anyways, just apply
this random patch from @DanOscarsson which apparently works for him and
call it a day. Fixes #13397.
2024-02-04 10:01:49 -06:00
Guido Cella
4ab521f080 command: add load-input-conf
This can be used to auto reload the input configuration file, e.g. in
vim:

autocmd BufWritePost ~/.config/mpv/input.conf silent !echo load-input-conf %:p | socat - /tmp/mpvsocket

Partially fixes #6362.

Additionally this can be used as a replacement for deprecated input
sections if they are ever actually removed. For example, if you want to
define different bindings for images, you can load-input-conf an
input.conf for images, and load the original again when switching to a
video. Though currently you would have to redefine builtin bindings that
were overwritten with image ones in the default input.conf.
2024-02-04 15:12:02 +00:00
Guido Cella
68e3412fee input: make parse_config_file return bool
This return value is only used to set bool config_ok in
mp_input_load_config so it makes more sense to return bool.
2024-02-04 15:12:02 +00:00
Guido Cella
484ab32a41 input: remove unused parameter from parse_config_file
This is unused since fb4d26e769.
2024-02-04 15:12:02 +00:00
Guido Cella
e2284fba18 command: add load-config-file
Unlike set include mpv.conf, this works after playback has started. It
can be used to auto reload the configuration, e.g. in vim:
autocmd BufWritePost ~/.config/mpv/mpv.conf silent !echo load-config-file %:p | socat - /tmp/mpvsocket

Partially fixes #6362.
2024-02-04 15:12:02 +00:00
nanahi
27cb193f0e wayland_common: warn if scrolling will be broken
Since the scroll event handler is moved to wl_pointer_frame, version 5 of
wl_seat is required. Warn that scrolling is broken if the compositor
doesn't support that verison.
2024-02-04 02:14:11 +00:00
nanahi
e0f9cf61b9 wayland_common: add touch listener boilerplate
Required if seat version >=6 is used.
2024-02-04 02:14:11 +00:00
nanahi
b3edb46fd9 wayland_common: prefer axis_value120 if supported
Prefer axis_value120 for high resolution scrolling if supported, which
matches the existing win32 behavior.
2024-02-04 02:14:11 +00:00
nanahi
f95b7146d7 wayland_common: properly handle high resolution scrolling
Commit f54ad8eb05 broke high resolution
scrolling because one logical mouse click is generated for every scroll
event, no matter the magnitude. This makes scrolling on trackpad way
too fast.

Revert the axis scaling change in that commit and clamp the resulting
value between -1 and 1 to make sure mouse wheel scrolling works as
intended on compositors which send a value larger than 10 for these events.
2024-02-04 02:14:11 +00:00
Guido Cella
fe0c181b1c DOCS/mpv: document how mf:// URLs are formed 2024-02-02 11:39:47 +01:00
Guido Cella
b2bc3c239c demux_mf: explain why a printf format is unsupported 2024-02-02 11:39:47 +01:00
Guido Cella
f935dafa24 demux_mf: remove code repetition 2024-02-02 11:39:47 +01:00
nanahi
aaaadc9d6b x11_common: support --title-bar
Some X11 window managers support controlling the title bar independently
from other window decorations with _MOTIF_WM_HINTS. This allows hiding
the title bar while keeping other decorations like the resizing borders.

Let mpv respect the --title-bar option on X11 so --no-title-bar can hide
the title bar only like on win32.
2024-02-02 11:39:30 +01:00
Dudemanguy
26a51464b6 demux_mkv: detect images by reading blocks and timecodes
4709a94aec along with some related commits
added a way to detect image codecs embedded into mkv streams that
weren't tagged with attached picture (arguably a broken file anyways,
but maybe not the worst thing to workaround). Unfortunately, this has
some false positives particularly with mjpeg playback. So, as usual,
revert and rewrite. Instead, we can probe the file and count blocks in
the stream. If the video stream has only 1 block and 1 timecode, then
assume it's a still image.
2024-02-01 22:12:22 +00:00
Dudemanguy
289b3a432e Revert "demux_mkv: check if the video codec is an image"
This reverts commit 4709a94aec.
2024-02-01 22:12:22 +00:00
Dudemanguy
adcc6794b5 wayland: look for "default" cursor as well as "left_ptr"
Some themes are apparently getting rid of "left_ptr" and using the
cursor spec names instead. Check for "default" as well. Fixes #13376.
2024-02-01 15:26:46 +00:00
Kacper Michajłow
57d6826249 meson: bump libplacebo required version to 6.338.2 2024-01-31 15:38:21 +00:00
Kacper Michajłow
e2e75906da io: add mp_save_file
Move from vo_gpu_next.c to io.c and return result.
2024-01-31 15:38:21 +00:00
Kacper Michajłow
69891c4070 vo_gpu_next: save cache to separate files
Save the cache to separate files to avoid loading/saving a huge combined
libplacebo.cache. This approach allows the saving of only new cache
objects and avoids resaving the entire cache, especially even if only a
tiny change was made.

This commit improves the cold start time of mpv and avoids saving data
when it's not necessary.

Number of changes were made:
- each cached object is saved in its own file
- cache files are prefixed with the name of cached object
- cache directory is cleaned on each uninit
    - the least recently used cache files are removed if cumulative cache
      size is above limit
    - files used in the recent 24 hours are not removed to allow changes
      to mpv.conf without worrying about the cache being removed during
      experimentation
- shader cache size limit is set to 128 MiB
- icc cache size limit is set to 1.5 GiB
- cache objects are loaded/saved as needed

This commit eliminates the runtime performance penalty associated with
the size cache. While we continue to maintain the cache limit to prevent
retaining stale objects, mpv now only loads a small subset of files that
are currently required for playback, instead of loading all files.
2024-01-31 15:38:21 +00:00
Kacper Michajłow
a59b8edb96 stream: increase max_size to INT_MAX minus padding
No need to magic number limit, we can support up to INT_MAX with current
code. Which should be more than enough.
2024-01-31 15:38:21 +00:00