Commit Graph

49722 Commits

Author SHA1 Message Date
Guido Cella 7f2bc43a68 demux_lavf: extract is_image function 2022-09-20 19:35:25 +02:00
Guido Cella 565e7d906c demux_lavf: detect avif images
Detect avif files with 1 frame as images. This works because AV1 videos
and AVIF animations have nb_frames 0 or > 1.
2022-09-20 19:35:25 +02:00
Leo Izen 4856a7bd59
DOCS/man/options.rst: replace some legacy single-hyphen syntax
Replace some occurrences of ``-option`` with ``--option`` to
coincide with the current option sytnax.
2022-09-20 10:08:28 -04:00
Niklas Haas 1fb5f06c66 vo_gpu_next: support error diffusion dithering
One step closer to vo_gpu_next feature parity with vo_gpu!
2022-09-20 14:59:00 +02:00
Oneric 9e3ec04d56 sub: use Unicode linebreaking for non-ASS subs and OSD
ASS must only automatically break at ASCII spaces (\x20), but other
subtitle formats might expect more breaking oppurtinities.
Especially non-ASS subs in scripts, which typically do not use (ASCII)
spaces to seperate words, like e.g. CJK, might overflow the screen
if the conversion didn't insert additional linebreaks (ffmpeg does not).

Thus try to enable Unicode linebreaking for converted subs and the OSD
if libass is new enough. The feature may still be unavailable at runtime
if libass wasn't build with Unicode linebreaking support.
2022-09-19 15:56:38 +02:00
rcombs ba81e4ed88 ao_audiounit: get the channel layout from the AU itself
Fixes 5.1/7.1 output mapping on tvOS 16,
and also makes the AC3-layout hack unnecessary.

Also adds some diagnostic log messages.
2022-09-15 11:52:50 -05:00
rcombs 588cb9a977 mac: avoid unnecessary unsafe conversions; fixes crash in debug builds
Previously, running a debug build of mpv would crash with this output
when preinit() at vo_libmpv.c:732 calls control(vo, VOCTRL_PREINIT, NULL):

Swift/Optional.swift:247: Fatal error: unsafelyUnwrapped of nil optional

This comes from this line of code:

var data = UnsafeMutableRawPointer.init(bitPattern: 0).unsafelyUnwrapped

Unsafely unwrapping a UnsafeMutableRawPointer.init has always been UB,
but the Swift runtime began asserting on it in debug builds a couple macOS
versions ago.
2022-09-14 16:28:12 -05:00
DeadNews 750b58a5a3 TOOLS/lua/autoload: add `m2ts` extension
* `.m2ts` used for the Blu-ray disc container file format
2022-09-14 14:49:00 -04:00
Christoph Heinrich e302c9b7dd ytdl_hook: simplify exclude option parsing
The parsing used to be unnecessarily complicated,
now it's easier to read and understand.
2022-09-14 13:29:11 +02:00
Niklas Haas b9c7e5b5ff vo_gpu_next: only require full pixel byte alignment
The current code also rejects e.g. rgb30, even though this format is
perfectly valid, because it only checks for alignment of the used bits.
2022-09-12 16:01:07 +02:00
Niklas Haas 30ca46259e vo_gpu_next: implement ICC 3DLUT caching
Relies on a new upstream API for adding save/load callbacks to the ICC
3DLUT generation parameters.

Closes: https://github.com/mpv-player/mpv/issues/10252
2022-09-12 15:35:17 +02:00
Niklas Haas 7a6dc79e29 vo_gpu_next: use correct pixel size when mapping formats
`total_bits` may be less than the true pixel stride (`bpp`) for formats
which contain extra ignored components (e.g. rgb0).
2022-09-12 15:25:56 +02:00
Thomas Weißschuh 38a7562ebe ao_pipewire: listen to hotplug events 2022-09-11 20:24:42 -07:00
Thomas Weißschuh f36eeaf4e8 ao_pipewire: use proper hotplug init APIs 2022-09-11 20:24:42 -07:00
Thomas Weißschuh aa7223cd8c ao_pipewire: create is_sink_node helper 2022-09-11 20:24:42 -07:00
Thomas Weißschuh 235a66bfc8 audio: list devices for all AOs with hotplug_init
Previously we would only call list_devs() on available AOs if an AO
*did not* have a hotplug_init() callback or for the first one that *did*
have it.

This is problematic when multiple fully functional hotplug-capable AOs
are available.

The second one would not be able to contribute discovered devices.

This problem prevents ao_pipewire from introducing full hotplug support
with hotplug_init().
2022-09-11 20:24:42 -07:00
Thomas Weißschuh 013ec877f6 audio: try to use playback AO as hotplug AO first
When a platform has multiple valid AOs that can provide hotplug events
we should try to use the one that also provides playback.

Concretely this will help when introducing hotplug support for
ao_pipewire.

Currently ao_pulse is probed by ao_hotplug_get_device_list() before
ao_pipewire and on the common setups where both AOs could work pulse
will be selected for hotplug handling.
This means that hotplug_init() of ao_pipewire will never be called and
list_devs() has to do its own initialization.
But if ao_pulse is non-functional or not compiled-in suddenly
ao_pipewire *must* implement hotplug_init() for hotplugging events to
work for all.

Also if the hotplug ao_pulse connects to a PulseAudio instance that is
not emulated by the same PipeWire instance as the playback ao_pipewire
the hotplug events are useless.
2022-09-11 20:24:42 -07:00
Thomas Weißschuh a9155c6f97 ta: increase size of names printed
30 characters are not a lot.
Also when the name is calculated from the allocation site the line
number will be the at the end of the name, so truncating it is
especially inconvenient.
2022-09-11 20:24:42 -07:00
Thomas Weißschuh 535cd6f313 ao_pipewire: handle AOCONTROL_UPDATE_MEDIA_ROLE 2022-09-10 12:32:52 -07:00
Thomas Weißschuh 3167a77aa3 audio: add AOCONTROL_UPDATE_MEDIA_ROLE
This is used to notify an AO about the type of media that is being
played.
Either a movie or music.
2022-09-10 12:32:52 -07:00
Thomas Weißschuh 221bf540a1 ao_pipewire: fix indent 2022-09-10 12:32:52 -07:00
Philip Langdale 98f02e33ef repack: add repacker for ccc16x16 formats
I'm adding support in ffmpeg for the XV36 format which will be used
by VAAPI for 12bit 4:4:4 content. It's an undefined-alpha channel
variant of Y412 which is itself a 12bit+4bits padding variant of Y416.

We currently have a repacker for full four channel cccc16, and for
three channel ccc16, but nothing for ccc16x16 with the undefined alpha
channel.

It's simple enough to add one using the existing macros.
2022-09-10 12:31:44 -07:00
Vitaly Zaitsev ca9b00145c mpv.metainfo.xml: add XDG appstream metadata manifest 2022-09-09 19:28:26 +02:00
Cairn a7098a4336 DOCS: Mention "mono" audio channels option 2022-09-09 13:00:58 -04:00
25792431 d433c5d655
DOCS/libmpv: fix typo in linkage section 2022-09-03 12:54:48 -04:00
Thomas Weißschuh 7a7042a4d1 w32: fix typo in F23 mapping 2022-09-03 08:46:42 -04:00
Tillmann Karras 1800891a1d vo_gpu_next: fix typo affecting --target-trc option 2022-09-02 22:03:33 -04:00
Thomas Weißschuh c4db110c8e macos: add support for F13-F20 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh c5e5fba632 w32: add support for F13-F24 keys
Fixes #10595
2022-09-02 14:05:46 +02:00
Thomas Weißschuh 103efdd614 x11: add support for F13-F24 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh 03e8ed450d wayland: add support for F13-F24 keys 2022-09-02 14:05:46 +02:00
Thomas Weißschuh 5d3680c314 input: add function keys F13-F24 2022-09-02 14:05:46 +02:00
Niklas Haas 9be52e5dd8 ad_lavc: strip non-normalized floats
`opus` codec likes returning denormalized floats in some cases, causing
wacky issues.

Fixes #10290
2022-09-02 01:27:31 +02:00
Niklas Haas 04062b6f89 vo_gpu_next: display subtitles without video stream
Fixes https://github.com/mpv-player/mpv/issues/10594
2022-08-31 13:33:05 +02:00
sfan5 0421e81965 DOCS/options: update vd-lavc-skiploopfilter, skipidct and related descriptions
Cross-checked the current functionality of these with the FFmpeg source.
2022-08-31 11:29:39 +02:00
Avi Halachmi (:avih) 0f30b0757f DOCS/mpv: remove spaces at EOL, ensure 80 cols
These are fixes for the previous commit.
2022-08-29 16:33:38 +03:00
enly1 92c03a191b DOCS/mpv: added COMMAND INTERFACE refs to INTERACTIVE CONTROL
Added COMMAND INTERFACE references to make it easier for new users.
2022-08-29 16:26:15 +03:00
Thomas Weißschuh 211ce69f74 ao_pipewire: for_each_sink(): report errors 2022-08-28 10:46:54 -07:00
Owen Rafferty 1a32bd37e0 meson: fix condition for enabling vaapi-egl 2022-08-27 10:53:05 -07:00
Niklas Haas 89cab5c32f meson: fix libplacebo check
Missing waf quivalent, and doesn't necessarily output a good error
message. But I might as well submit this rather than sitting on it
unnecessarily.
2022-08-26 02:24:20 +02:00
Philip Langdale ed7717298b audio: fix lack of reinitialization on format change with pull AOs
uau did some investigation and noticed that we do not send a wakeup
event when we encounter end-of-stream in ao_read_data(), in contrast to
the equivalent logic for push AOs in ao_play_data().

Inserting that wakeup fixes the original problem of lack of
reinitialization on a format change without the problems we saw with
the previous attempted fix.

Fixes #10566
2022-08-23 11:01:52 -07:00
Philip Langdale e2e8c21be4 player/audio: remove explicit drain on EOF
We have previously had a problem where pull AOs (such as pipewire)
would not reinitialize on a format change when going between two
audio-only files. In such a situation, playback would stop after the
first file.

We initially attempted to fix this by explicitly draining on EOF, which
solves that problem but introduces a blocking step where we don't
actually want one, breaking gapless audio, and causing dropped frames
at the end of playback for files with video in them too.

So, let's undo these changes and do something better in the next
commit.
2022-08-23 11:01:52 -07:00
Thomas Weißschuh 6c1f01d284 ao_pipewire: make sure not to exceed the available buffer
The error description in #10545 could indicate that we are overflowing
we are corrupting the buffer metadata ourselves through out-of-bound
writes.
This check is also present in pw-cat so it seems to be expected for
b->requested to exceed the actual available buffer space.

Potential fix for #10545
2022-08-21 18:38:53 +02:00
Thomas Weißschuh bf5c19e05b audio: don't try to drain non-existent AO
52aed495cb ("audio: drain ao on EOF") introduced logic to drain an AO
when EOF of the input has been reached.
When no AO however is present this leads to a NULL-dereference.

Fixes #10556
2022-08-21 08:05:13 -07:00
Niklas Haas 37aea112c1 vo_gpu_next: pass GL get_proc_addr pointer to libplacebo
Facing down the multitude of ways to somehow wrangle the get_fn pointer
out of the GL environment and into libplacebo, I decided the easiest is
to just store it inside the GL struct itself.

The lifetime of this get_fn function is a bit murky, since it's not
clear on whether or not it survives the VO init call (especially in the
case of the GL render API, which explicitly states that parameters do
not need to survive the call they're passed to), so just add a
disclaimer.

(It's fine for us to use like this because `gpu_ctx_create` is still
part of VO init)

Closes https://code.videolan.org/videolan/libplacebo/-/issues/216
2022-08-19 13:54:50 +02:00
Thomas Weißschuh 891c9c869f ao_pipewire: test on FreeBSD 2022-08-18 09:16:52 -07:00
The-head-obamid d5b0f5648d mpv.desktop: add RIST protocol to desktop entry 2022-08-18 11:33:50 +02:00
The-head-obamid 4c431c8ad6 osxbundle: add RIST protocol support to app metadata 2022-08-18 11:33:50 +02:00
The-head-obamid f344d481a5 stream_lavf: enable RIST protocol support via ffmpeg 2022-08-18 11:33:50 +02:00
Thomas Weißschuh e735f7f61a ao_pipewire: restructure logic a bit 2022-08-17 15:48:12 -07:00