Commit Graph

50397 Commits

Author SHA1 Message Date
rcombs ba7cc07106 sub: rewrite auto-forced-only support
- No longer has a fake "option" used only internally (which didn't always get propagated properly)
- Always overrideable during playback
2023-06-25 11:01:58 +02:00
rcombs 991a2f79ce player: add more precise sub fallback options 2023-06-25 11:01:58 +02:00
rcombs 5dfa3f7f08 options: default slang to auto 2023-06-25 11:01:58 +02:00
rcombs 5f146e742a loadfile: support "auto" as a language option
This uses the user's OS-level preferred set of languages
2023-06-25 11:01:58 +02:00
rcombs 76009bf7a6 loadfile: use mp_match_lang_single
This adds basic support for IETF language tags,
as well as matching 2-letter language codes against 3-letter ones (and vice versa).
2023-06-25 11:01:58 +02:00
rcombs eb14dbff3e loadfile: take a const char* in match_lang 2023-06-25 11:01:58 +02:00
rcombs be34f52f72 loadfile: short-circuit early on null stream language 2023-06-25 11:01:58 +02:00
rcombs 57dae8f42c osdep: add mp_get_user_langs 2023-06-25 11:01:58 +02:00
rcombs 0463096b3c osdep: move cfstr<->cstr conversions to a new apple_utils.c file 2023-06-25 11:01:58 +02:00
rcombs 8c8d97c26c misc: add language-matching utilities 2023-06-25 11:01:58 +02:00
rcombs 1669c4698d options: set subs-with-matching-audio to off by default
This means that subtitles won't be displayed unless the user asks for them
2023-06-25 11:01:58 +02:00
Philip Langdale 78285e98f1 vo: hwdec: prioritise `drmprime` over `drmprime_overlay`
I originally left `drmprime_overlay` as higher priority because
`drmprime` was new, and because I didn't have any hardware where both
worked (only one or the other) so I couldn't compare relative
performance, and if only one worked, the priority didn't matter.

But with time and more usage, we've reached a point where we can say we
would recommend using `drmprime` in situations where both work, and
we've also been able to identify hardware where both do indeed work and
it seems that `drmprime` is more reliable.

So, let's flip them.
2023-06-22 12:46:21 -07:00
NRK 32147956ca ad_lavc: check for allocation failure
Fixes: https://github.com/mpv-player/mpv/issues/11792
2023-06-22 18:13:11 +02:00
Niklas Haas 0af81b16d8 vo_gpu_next: add --corner-rounding option
For better or worse.
2023-06-21 23:52:35 +02:00
Niklas Haas f1600ea9cf vo_gpu_next: add missing --gamut-mapping-mode options
Adds the missing upstream values that were exposed by the new gamut
mapping API.
2023-06-21 23:52:35 +02:00
Thomas Weißschuh 594458838e ao_pipewire: bump dependency to 0.3.48
Now that Debian 12 is release bump the minium required version to what
is provided in Ubuntu Jammy (22.04).
The same as has been done for the wayland dependencies.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-06-21 17:33:31 +02:00
Kacper Michajłow 71c80826f1 ao_wasapi: use client name instead of hardcoded string 2023-06-21 17:31:59 +02:00
Kacper Michajłow 3dc661fe8e ao_wasapi: remove infinite loop hack in AOCONTROL_UPDATE_STREAM_TITLE
Instead of brute forcing the name until it is set, without any error
checking and expecting it would start to work, fallback to client name
if initial request fails.

Fixes player going into infinite loop with very long title names. The
API rejects unreasonably long names, which make sense.

As for alleged "weird race condition in the IAudioSessionControl itself"
I cannot comment. It works on my end and even if it fails, it is not a
critical error or even something that we should care about... and
obviously not hang the whole player for that.

Fixes: #11803
2023-06-21 17:31:59 +02:00
Leo Izen ee155d79fd demux/demux_lavf: avoid leaking AVFormatContext during demux_open_lavf
If demux_open_lavf fails between calling avformat_alloc_context() and
assigning the context to priv->avfc, it will never be properly freed.

Fixes #11793.
2023-06-18 09:54:52 -04:00
Dudemanguy 650c53df50 vo_dmabuf_wayland: drop linux-dmabuf-v2 (again)
It was done once before but later reverted for testing reasons. This
time it's permanent though since I can test this VO on ARM and with an
up to date system.
2023-06-16 14:46:59 +00:00
Dudemanguy ca08bf599f wayland: bump wayland-protocols to 1.25
1.27 would have been nicer but ubuntu 22.04 is on 1.25 so we'll just
compromise.
2023-06-16 14:46:59 +00:00
Dudemanguy 45e2ca5411 wayland: bump required version to 1.20
This lets us remove some ifdefs.
2023-06-16 14:46:59 +00:00
Leo Izen d16f971df5
DOCS: fix admonition typo
Fix missing second : in DOCS/man/options.rst after a .. admonition::
2023-06-15 12:28:18 -04:00
Dudemanguy f5e828ac25 vo_dmabuf_wayland: update the image of pending buffers
When using a display-* video-sync mode, it is possible for buffers with
a matching id to already have an image associated with them (i.e. the
compositor hasn't released it yet). Previously, it was thought that we
could just unref, return null, and make a new buffer but this eventually
leads to a fatal error that originates from libwayland itself which
stops playback. Admittedly, the reason for the error is a bit nebulous
but likely it seems to be some kind of mismatch between dmabuf params
and the associated image with the buffer.

However, we can simplify this process greatly. Instead when the
previously mentioned edge case happens, the old image can simply be
freed and we give the buffer the new image. This saves creating a new
buffer and also avoids that nasty libwayland error. A nice win-win all
around. Fixes #11773.
2023-06-14 12:21:10 -05:00
Dudemanguy 4d4837b84e vo_dmabuf_wayland: use a minimum of 15 buffers
vo_dmabuf_wayland has a pool of wl_buffers that it cycles through when
drawing frame. There needs to be at least some minimum number otherwise
a flickering artifact occurs where old frames are mistakenly repeated.
When using display-resample and other similar modes, it seems more
buffers are required (more drawing happens so it makes sense) and the
current minimum of 8 isn't good enough. Let's just bump this to 15. It's
also a random ad hoc number, but as far as I know there's not really a
way to predict how many buffers a random video may need. From testing,
it works fine and overall 15 is still a tiny amount of objects to create
considering the lifetime of a video, so we'll just go with this.
2023-06-14 12:00:23 -05:00
sfan5 f1c9daa169 ci: use a different mirror for freetype
GNU decided to break theirs
2023-06-13 10:01:05 +02:00
Dudemanguy 8ecf2d37eb player: add drag-and-drop option
Some platforms (wayland) apparently have a lot of trouble with drag and
drop. The default behavior is still the same which is basically obeying
what we get from the window manager/compositor, but the --drag-and-drop
option allows forcibly overriding the drag and drop behavior. i.e. you
can force it to always replace the playlist or append at the end. This
only implements this in X11 and Wayland but in theory windows and macos
could find this option useful (both hardcode the shift key for
appending). Patches welcome.
2023-06-12 20:50:08 +00:00
Dudemanguy 2f8d9322fd wayland: avoid misleading log messages on drag/drop
In data_offer_actions, it's possible to get the
WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE action which would set
wl->dnd_action to DND_APPEND (did nothing in practice) but also log a
message which is confusing and misleading. Instead, just ignore and
don't do anything when we get this case.
2023-06-12 20:50:08 +00:00
Kacper Michajłow 1c82d6ae7a ci/mingw: add dlltool to the meson crossfile 2023-06-08 19:52:10 -04:00
OlesyaGerasimenko 309a139e67
mpv.desktop: add Russian translation for GenericName
Added Russian translation for "GenericName", updated Russian
translation for "Comment".
2023-06-08 06:46:05 -04:00
Kacper Michajłow 6ff131add0 ci/mingw: remove cache
To avoid building against stale version of dependencies. In particular
libplacebo is moving target and as we can see the build has been broken
few times recently, so let the CI validate it for us.

The time to build everything is under 30 minutes, which is acceptable in
my opinion, not much longer than macos build.
2023-06-08 06:26:06 -04:00
Kacper Michajłow 8037320920 ci/mingw: update dependencies versions 2023-06-08 06:26:06 -04:00
Kacper Michajłow 5c7a9490cb ci/msys2: enable egl-angle-lib
Now that it has been fixed upstream we can enable and test if it links
correctly.
2023-06-08 06:25:23 -04:00
Leo Izen 6932a27781 github/workflows/build.yml: install ca-certificates package on msys2
Allows python to download waf correctly, fixing CI failure due to its
outdated built-in certificate pool.
2023-06-08 12:09:57 +02:00
Leo Izen 7fe727555d bootstrap.py: update waf to 2.0.25
Fixes some minor bugs in waf.
2023-06-08 12:09:57 +02:00
Guido Cella 1fbaf4602e DOCS/mpv: add an example for applying profiles to certain paths
It is worth adding this example because it has been asked multiple times
in the issue tracker and the IRC channel.

string.find() is used because it's 20 times faster than string.match().
2023-06-07 19:04:21 -04:00
Arthur Williams 46ee31b655 player: don't load unwanted files after 519e56f
519e56f caused an attempt to get the language even if the file name
didn't start with the movie title. However, detecting a language when
fuzz >= 1 or the language is known, caused prio to be non-zero which
caused the file to be included regardless of its name. This shouldn't be
the behavior when sub-auto != all.

Now all the prio updates that depend on lang will only happen if the
file in question starts with the movie name. Since language was never
detected before if this wasn't true, the behavior should be the same as
before 519e56f when sub-auto != all.

Closes: #11749
2023-06-07 10:17:28 +02:00
Philip Langdale effc68063b hwdec_cuda: bump required headers version for timeline semaphores
We're moving to using timeline semaphores for synchronisation between
cuda and vulkan. It's only required with libplacebo-next right now,
but eventually our baseline libplacebo requirement will increase, so we
will need new enough nvidia headers that include the necessary
declarations.
2023-06-04 13:25:43 -07:00
Philip Langdale 3a6738ed8c hwdec_cuda: clear vulkan semaphore fd after passing ownership to cuda
This is not technically necessary, because we never touch the fd again
after passing to cuda, but having it there could lead to future code
accidentally using it.
2023-06-04 13:24:52 -07:00
Philip Langdale 7918545caf hwdec_vulkan: respect probing flag when logging during init
All hwdecs should respect the probing flag and demote their lgoging to
verbose level, so that initialisation failures during probing do not
spam the user. I forgot to do this for the Vulkan hwdec.
2023-06-03 18:37:43 -07:00
Philip Langdale ba6af0fb15 vulkan: don't assume all ra_ctx implementations have a swapchain
The dmabuf-wayland vo has a stub ra implementation that doesn't
have a swapchain. That means that it's currently not safe to call
ra_vk_ctx_get on that ra_ctx, but it must be safe to call on all ra
implementations as this is how we discover if it is a vulkan ra.

This hasn't been an issue before because no Vulkan code paths would be
triggered when using dmabuf-wayland, but with the new vulkan hwdec, it
becomes possible to trigger when hwdecs are probed.
2023-06-03 18:37:43 -07:00
Philip Langdale c8790a9173 hwdec_cuda: remove usage of deprecated libplacebo sync API
The libplacebo sync abstraction is deprecated and we should be using
the more explicit Vulkan semaphore helpers instead. This means that
more of the book keeping moves to our side, but it's not too bad.

There are two main things going on here:

1. After a lot of back and forth, I decided to write the new code with
   timeline semaphores to streamline things, and that also means all
   the variables are separate - which makes the #ifdefs easier to read.
   Which is important because:

2. While pl_sync owned the exported fd/handle, pl_vulkan_sem does not,
   so we are responsible for managing them. That means reversing the
   previous logic - we now can pass an original fd to CUDA and never
   think about it again, while we have to clean up a Win32 Handle
   because CUDA will not take ownership.
2023-06-03 18:15:20 -07:00
sfan5 e18cf0b92a video/out/android: assert WinID value before use 2023-06-03 17:07:43 +02:00
Kacper Michajłow c1bef0f084 path: handle URLs consistently in mp_basename
Detect URLs and skip DOS path processing as it is likely to do
unexpected thing when ":" is found.
2023-06-01 22:47:48 +02:00
Christoph Heinrich 83acd93c6a lua: read_options: find script-opts prefix at index 1 exactly
Finding the prefix in the key is not enough, the key has to actually
start with the prefix. Otherwise a key like `uosc-font_scale` will not
only match the `uosc-` prefix, but also the `osc-` prefix, resulting
in a logged warning about `-font_scale` being an unknown key.
2023-06-01 15:11:55 +03:00
Kacper Michajłow f79458476b demux/demux_lavf: strip URL parameters before matching extension
Unfortunately Content-Type matching seems to be not enough as there are
mistagged streams. Try to match extension and pass-through URL.

Fixes #11700
2023-05-30 10:54:21 +02:00
Philip Langdale bc28dce303 hwdec_vulkan: enable AV1 support if available
AV1 support in Vulkan is extremely bleeding edge - to the point that
the extension is not present in official Khronos releases, but it has
a reserved identifier and we can look it up with a string literal for
now.

This will be skipped and ignored if the driver doesn't support it, so
it's safe if/when the name changes later (it'll just never be activated
in that case).
2023-05-29 14:46:42 -07:00
Philip Langdale 0f37d72360 hwdec_vulkan: check for the correct libplacebo version
It's 6.278, rather than 5.278.
2023-05-29 14:39:22 -07:00
sfan5 0d1b96c233 vo: hwdec_aimagereader: fix compile
forgotten in 085f3e31a0
2023-05-29 22:50:35 +02:00
Philip Langdale 0131ae4133 hwdec_vulkan: simplify requirement checks for Vulkan interop
I originally wrote this trying to avoid doing an explicit version check
on the headers, but it just makes things more confusing, and the
requirements harder to understand.

So, Vulkan interop now takes a dependency on the header release where
they finalised the video decode headers. VK_EXT_descriptor_buffer was
added in 1.3.235, so that's covered as well.

Along the way I fixed a bug in the waf build where it was depending
on libplacebo-next instead of libplacebo-decode.
2023-05-29 13:26:29 -07:00