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

50453 Commits

Author SHA1 Message Date
Alexandre Ratchov
1bbc7a2cd0 ao_sndio: use sio_flush() to improve controls responsiveness
Use sio_flush() instead of sio_stop() to improve controls responsiveness.
2023-07-30 19:28:14 +00:00
Dudemanguy
b7bf5e619f draw_bmp: fix overflowing coordinates in mark_rcs
This is yet another unfortunate side effect of the width % SLICE_W == 0
special case. While looping through these rectangles, the rc->x1 value
on the final loop can be greater than the actual total width. This will
cause a buffer overflow if using the mp_draw_sub_overlay API. 2 of the
current VOs that use that work around it by adjusting the values
returned, but the better fix is to correct what's actually given in the
rectangles so you can safely use the values. As for the fix, it's simply
ensuring that rc->x1 doesn't extend beyond p->w with a MPCLAMP.
Previously, the code would always naively add SLICE_W (256) to rc->x0
which would easily extend past the actual width in many cases. The
adjustments in vo_vaapi and vo_dmabuf_wayland are dropped and in theory
vo_direct3d should work now since we can just trust the values given to
us in the rectangles. How nice.
2023-07-30 20:06:20 +02:00
Thomas Weißschuh
1608059d64 Revert "audio: add AOCONTROL_UPDATE_MEDIA_ROLE"
The only user of these APIs was ao_pipewire and the logic there got
converted so drop the now dead code.

This reverts commit 3167a77aa3.
2023-07-30 19:48:35 +02:00
Thomas Weißschuh
0fb7ab62c5 Revert "ao_pipewire: handle AOCONTROL_UPDATE_MEDIA_ROLE"
As the role property is interpreted by wireplumber it can only be
evaluated when creating the stream. The current, dynamic mechanism is
racy so revert it.

See: #11253
Fixes: #12041
This reverts commit 535cd6f313.
2023-07-30 19:48:35 +02:00
Jan Beich
3bdf702b1d meson: look for linux/input-event-codes.h with libwayland flags
On DragonFly and FreeBSD native evdev headers are not not be used
outside of base system. Linux-compatible headers are provided by
evdev-proto package but require extra flags. As evdev-proto lacks
pkg-config support use libwayland prefix as approximation.

meson.build:974:0: ERROR: C header 'linux/input-event-codes.h' not usable
2023-07-29 19:43:28 -05:00
Kacper Michajłow
13b7d7771f version.py: fix build date
- Use ctime() instead manual format string. Fixes 12-hour format (%I)
  without AM/PM (%p) specified. It is 24-hours now, as it should be.
- Avoid naive datetime object.
- Fix timestamp type, it is float in Python.
- Remove dummy fallback branch.
- Use f-strings for readability.
- Always rebuild version.h if repository is dirty.
2023-07-30 00:38:45 +00:00
Dudemanguy
a2dd78fbc0 options: restore old default sub selection behavior
1669c4698d notably flipped the default of
--subs-with-matching-audio from yes to no as part of a series of changes
that gave more control over sub selection behavior. While the increased
amount of options is definitely nice, changing the default to no results
in very unintuitive behavior. For example, setting alang=en and slang=en
in your config will not show any subtitles since the audio stream is
English as well so --subs-with-matching-audio being no causes the subs
to not be be selected. This is very weird for users who reasonably
expect slang being set to actually result in showing subs and this is
what mpv did for the past decade.

The other case is when a subtitle does not have a language tag but is
flagged as default. Because --subs-fallback (a new option), defaults to
no, these subtitles also will not be loaded. This is also strange for
users since mpv previously loaded these and they would need to change
the value of this option. It's also inconsistent because audio tracks
that are tagged as default are also loaded by default.

The new behavior seems to have mostly just confused users, and it also
regresses their configs for unclear reasons. Let's just set the options
to be back in line with the old behavior with is what most users expect.
--subs-with-matching-audio goes back to being yes and the new option
--subs-fallback should be default. Fixes #11854.
2023-07-29 22:22:37 +02:00
Niklas Haas
3bf1d22879 vo_gpu_next: fix assertion on wayland
This code failed to handle the case of the swapchain submission being
skipped because the window was invisible.

Fixes: f9dc695b58
2023-07-29 19:09:45 +02:00
Niklas Haas
f9dc695b58 vo_gpu_next: delay swapchain submit until flip_frame()
Presents frames at the correct time when DS is disabled.
2023-07-29 17:09:59 +02:00
Kacper Michajłow
5fc305fa17 path-win: move state directory to %LOCALAPPDATA%
%LOCALAPPDATA% is where the local application state belongs.
2023-07-29 14:27:59 +00:00
Kacper Michajłow
aa05c06873 path-win: add subdirectory for cache
To not polute %LOCALAPPDATA%/mpv as it may be used for other things too.
2023-07-29 14:27:59 +00:00
Kacper Michajłow
089a8480a2 Revert "ci/msys2: double down on running meson through python3.11"
Python 3.11 will be released soon as default Python package, and
actually python3.11 package already disappeared from the repository.

This reverts commit c637beb522.
2023-07-29 12:33:50 +03:00
sfan5
4c3ed843dc ad_spdif: fix segfault due to early deallocation
The avpkt was created once on decoder init but destroyed each time the
filter was destroyed, this obviously can't work. Move the packet alloc
to the filter init function instead.

fixes: 4574dd5dc6
2023-07-27 22:56:37 +02:00
Dudemanguy
bb17d44835 test: enhance libmpv test
We already have a libmpv test, but it's really basic and barely does
anything. In an effort to hopefully prevent future breakage, lets expand
this to do more stuff. First of all, it simply tests setting a bunch of
properties/options. Secondly, it tries to load a file (the mpv icon that
we already have in the source tree). And then finally it tries the
lavfi-complex filter since this is a known special case where weird
things can happen.
2023-07-27 14:48:09 +00:00
Dudemanguy
65840f8889 player/video: check for track and decoder existence
The track during lavfi-complex can actually be NULL which meant that
ca4192e2df regressed lavfi-complex by
causing mpv to crash during runtime changes of the filter. Additionally,
it's possible for the decoder wrapper to also be NULL. check_framedrop
within write_video checks this, but check_for_hwdec_fallback does not.
Perhaps, it's impossible for this to happen, but we might as well add
the check here to be on the safe side since mp_decoder_wrapper_control
is not designed to handle a NULL.
2023-07-27 16:30:26 +02:00
sfan5
bc96b23ef6 video_writer: fix gamma for YUV screenshots
reproduction steps: take any lossy WebP screenshot and check the colors
(or JPEG without libjpeg support, or AVIF with tag-colorspace=no)
fixes: 6d9e72cd89
2023-07-26 11:26:36 +02:00
sfan5
90410cc17e image_writer: log pixfmt conversion 2023-07-26 11:26:36 +02:00
sfan5
e01ff88c83 encode_lavc: fix leak of codecpar 2023-07-26 11:26:36 +02:00
sfan5
ee25d0d2e0 zimg: fix abort on subsampled input with odd heights
We make the assumption that there is more buffer available
than indicated, this needs to be considered in this specific
location too as mp_image_crop understandably checks whether
we're about to do something unsafe.

minimal reproducer: mpv av://lavfi:testsrc -vf crop=320:239,format=yuv420p -o test.png

fixes #10469
2023-07-26 11:26:36 +02:00
sfan5
3bc75d02e0 demux_mkv: add missing space to log msg 2023-07-26 11:26:36 +02:00
Dudemanguy
de112a7932 build: remove unneeded libdl requirement for vaapi
Curiously, vaapi requiring libdl has always existed ever since support
was added to mpv (2827295703). After some
investigation in IRC from uau and JEEB, it was concluded that the libdl
requirement was blindly copied from the vdpau check above it. At the
time, the vdpau code actually used dlsym so it was needed. The check was
later dropped when waf support was added
(7e2edad8ef). However, the requirement in
vaapi lived on, and actually it was never needed. libva does use dl when
building its libraries unsurprisingly, but this isn't relevant to mpv in
any way. Just drop it.
2023-07-25 20:04:54 +00:00
Gusar321
4332553db5 build: refactor vaapi handling 2023-07-25 19:20:40 +00:00
Kacper Michajłow
38ad2467a4 ci/mingw: reduce git clone depth to 1 2023-07-25 11:34:59 +02:00
Kacper Michajłow
95a2d5b044 ci/mingw: use ccache
Can significantly reduce build time, most of dependencies have fixed
versions, so they can be cached fully. Others will be incrementally
build.

Cache is saved on every run and restored from the newest one. Size is
limited to 500M (compressed) to keep cache save/restore fast. Clean
cached build is little over 100M, so we have a headroom as things will
grow. ccache will automatically evict least recently used entries.

It is unlikely that clean build will exceed the limit anytime soon, but
it is something to keep in mind, as we do not want to evict cache
entries from current build, so the cache size need to be set correctly.
2023-07-25 11:34:59 +02:00
Kacper Michajłow
0e0b396af4 ci/mingw: disable fail-fast
Those builds should be evaluated separately, no need to fail other one.
2023-07-25 11:34:59 +02:00
Kacper Michajłow
d521ba38d1 ci/mingw: check if binary is runnable before packaging 2023-07-25 11:34:59 +02:00
rcombs
4ac5e6c810 language-posix: as a fallback, treat "C" as "en"
If we see "C" in one of the language vars we check, don't treat it as a language tag.
Once we've checked everything, if we don't have any languages, but saw "C" anywhere, fall back on "en".
2023-07-25 11:34:06 +02:00
Dudemanguy
4939570e17 msg: print MSGL_WARN and higher error messages to stderr
mpv has a convention of printing everything to stdout. The reasons for
this are pretty unclear and in certain situations rather unintuitive. It
leads to some bad behavior in fringe cases with encoding mode and isn't
the norm for programs so just adjust it so warnings and up are printed
to stderr. Fixes #8608.
2023-07-24 22:48:30 +02:00
Gusar321
99f367f219 build: vaapi-x-egl is not used anywhere, remove it 2023-07-24 22:27:54 +02:00
Gusar321
2902532917 build: vaapi-egl should explicitly depend on egl 2023-07-24 22:27:54 +02:00
Gusar321
2e3cb30e46 build: vaapi-drm and vaapi-wayland do not depend on egl 2023-07-24 22:27:54 +02:00
Kacper Michajłow
ff3739b36e ci/mingw: update luajit to fix i686 crashes
2.1.0-beta3 is ancient. Disable unwinding in luajit, as it requires SEH
to be enabled in the image, but it is not on i686 target and it
crashes when luajit tries to use SEH.
2023-07-24 19:44:34 +02:00
Dudemanguy
48eb77207b wayland: restore xkb_keysym_to_utf8 handling
In 1f8013ff3f, I mistakenly thought this
was only used for modifier presses way back in the commit it was
introduced in, but it actually also handles non-english keys/letters.
Instead of returning early, we should try xkb_keysym_to_utf8 first and
then return if that doesn't do anything so the modifier can then be
handled in the appropriate event. Fixes #12009.
2023-07-24 17:07:27 +00:00
Dudemanguy
9e449cc685 build: internally rename gl-wayland to egl-wayland
This has always been a pet peeve of mine and in fact I named the option
in meson "egl-wayland" with the intention of finally doing this. We call
everything that's egl "egl-foo" internally except for wayland.
2023-07-23 22:00:08 +00:00
LaserEyess
f2cce5f38f waf: remove waf as a build system
Remove waf entirely in favor of meson as the only supported build
system. Waf was officially deprecated in 0.36.0, and has not been
preferred over meson since 0.35.0.
2023-07-23 19:55:51 +00:00
sfan5
60a263246e Update VERSION 2023-07-23 19:18:17 +02:00
sfan5
f4210f8490
Release 0.36.0 2023-07-23 19:10:36 +02:00
sfan5
5236003db5 Revert "vo_gpu_next: use pl_dispatch_info_move to avoid useless data copy"
We wanted to preserve the libplacebo v5.264.0 requirement for gpu_next
for this release, since this is the what most Linux distributions are shipping.
The VLC 3 <-> libplacebo v6 situation is an additional reason distros are not
likely to ship the newest libplacebo release soon.
This reverts commit b73d96776c.
2023-07-23 15:40:41 +02:00
Thomas Weißschuh
007019a303 ao_pipewire: for_each_sink: properly check termination condition
Doing a pw_thread_loop_wait() without checking conditions is invalid.
The thread loop could be signalled for other reasons and in this case
the wait needs to continue.

PipeWire added such additional signaling in
commit 33be898130f0 ("thread-loop: signal when started").

This meant that for_each_sink would return before the callbacks have
fired and session_has_sink() would incorrectly return "false", failing
the initialization of ao_pipewire.

Fixes #11995
2023-07-23 13:31:03 +02:00
Dudemanguy
e8126e54e5 DOCS/vo: clarify dmabuf-wayland a bit
Make it clearer that you should be using --hwdec with this VO. Also make
some comments about the things that are required for this to work
correctly (i.e. working drivers/GPU and the right compositor).
2023-07-23 04:55:26 +00:00
Dudemanguy
783e2bf138 vo_dmabuf_wayland: correctly handle force-window
Since this works by mpctx giving us a dummy image, we can be reasonably
be confident that when we receive a matching imgfmt with no underlying
hw_subfmt that this is simply force window from the player. Just allow
this to go through the usual wayland logic and skip the hwdec checking.
When we get the real image later, it will still error out on the
compositors that don't have proper support.
2023-07-23 04:55:26 +00:00
Dudemanguy
ca4192e2df player/video: check for forced eof
It's a bit of an edge case, but since we now allow the disabling of the
software fallback it's possible to have a situation where hwdec
completely fails and the mpv window is still lingering from the previous
item in the playlist. What needs to happen is simply that the vo_chain
should uninit itself and handle force_window if needed. In order to do
that, a new VDCTRL is added that checks vd_lavc if force_eof was set.
player/video will then start the uninit process if needed after getting
this.
2023-07-22 17:42:25 +00:00
Dudemanguy
61f0797557 vd_lavc: respect vd-lavc-software-fallback opt
There's an option that's supposed to stop mpv from falling back to
software decoding if hardware decoding fails. Except that it doesn't
work and can fallback to software decoding anyway. Correct this by
checking if all possible hwdec failed after the loop in
select_and_set_hwdec and that we have this option. If so, flag a bool to
force eof. In decode_frame afterwards, we then simply immediately return
an EOF.
2023-07-22 17:42:25 +00:00
Gusar321
bddf0efade vo_vaapi: restore hardware video decoding
Commit e50db42 changed how hwdec interop works. Adjust vo_vaapi accordingly by setting the appropriate image format.
2023-07-22 12:16:29 +02:00
Gusar321
800d9eaa42 vo_vaapi: fix segfault in draw_osd
When video width is not a multiple of slice size, the last slice will overflow. Fix this by adjusting the width of the last slice to fit within the video.

Fixes issue #10436
2023-07-22 12:16:29 +02:00
Thomas Weißschuh
c9064b57c0 ao_pipewire: use native buffersize by default
Instead of trying to guess the correct number in mpv let the pipewire
server choose.

Fixes #9992
2023-07-22 12:16:21 +02:00
NRK
2dc8e70093 terminal-unix: fix not listening on input after being foregrounded
fixes regression caused by 2e7fcc5a2 where it wouldn't receive terminal
input if the process was foregrounded later on like this:

    $ mpv something.mp4 &
    $ fg

ref: https://github.com/mpv-player/mpv/issues/11795
2023-07-21 20:47:03 +02:00
llyyr
4198e6f35f osc: don't add margins to osc-deadzonesize
Currently, the osc will add a margin of (osc_height / 2) to the
deadzonesize for the window controls, the topbar and the bottombar,
i.e. when osc-deadzonesize=1, the osc will show up even if the cursor
is only hovering (osc_height / 2) pixels above or below it. This is not
what this option is supposed to do according to the manual, instead
osc-deadzonesize=1 should result in the osc only appearing when it is
directly hovered. The user can simply set osc-deadzonesize=0.9 or so if
such a margin is desired, instead make the option work as advertised by
removing this margin.

It should be noted that osc-layout=box does not share this behavior,
and it already works as advertised in the manual.
2023-07-21 20:24:18 +02:00
Dudemanguy
45b006b958 DOCS: clarify screenshot window and screenshot-sw 2023-07-21 20:23:11 +02:00
Dudemanguy
9a95cb9fd1 vo_drm: remove VOCTRL_SCREENSHOT_WIN
With the generic screenshot window implemented, this is no longer
needed since vo_drm already uses software scaling.
2023-07-21 20:23:11 +02:00