Commit Graph

51819 Commits

Author SHA1 Message Date
nanahi a61026aec3 d3d11: set window to transparent if --alpha=yes is specified
This makes --alpha=yes work with d3d11 and --d3d11-flip=no.
transparent window doesn't work with flip model swapchain by design.
2024-02-17 16:06:33 +00:00
nanahi cef378b0a3 w32_common: add function to control window transparency state
Use the DWM API to enable and disable compositor transparency.
2024-02-17 16:06:33 +00:00
Dudemanguy 965119a2b7 command: add window-id to MPV_EVENT_VIDEO_RECONFIG property change
25b66256d7 originally added this
property, but it did not add it to the property notification. This is
possibly because the window id doesn't appear to change on x11 even when
toggling VOs at runtime. However, windows uses this property and
apparently the id changes there so we should signal updates when
appropriate. Fixes #13495.
2024-02-17 15:41:23 +00:00
nanahi 98005003da DOCS/man: add description of display-names property for wayland
On wayland, depending on the wl_output protocol version used,
the display-names property can have different values. Mention
this in the documentation, like for other platforms.
2024-02-16 23:06:13 +00:00
Dudemanguy c0c32b270e vo_gpu_next: don't add 0 width/height sub bitmaps to pl_overlay
Previously, libplacebo would fail to render the image since mpv was
feeding it bogus bitmaps with 0 width/height. An easy way to encounter
this would be to set sub-scale to 0 with bitmap/image subs.
2024-02-16 22:46:31 +01:00
Jose Maldonado aka Yukiteru 293532057e osdep/threads-posix: fix headers for OpenBSD build
In OpenBSD the compilation fail because osdep/threads-posix.h
need include pthread_np.h
2024-02-15 16:46:12 +00:00
nanahi e19061605f DOCS: document --input-preprocess-wheel option
Document the use cases for enabling or disabling the wheel preprocessing.
Also note that this option has no effect on any filtering already done
by the OS/driver.
2024-02-15 16:44:32 +00:00
nanahi 690dc201ad input: add --input-preprocess-wheel option
This adds --input-preprocess-wheel option, which can be used to control
whether to preprocess received wheel events.

Commit 937128697f added preprocessing of
wheel events to prevent the accidental scrolling of another direction
when one direction is being scrolled for touchpads, which is problematic
with the default wheel bindings where unrelated functions (seeking and
volume) are used for the 2 directions.

However, this behavior is undesirable in the following situations:

- When custom wheel bindings are used so that the 2 directions are used
for closely related actions, such as panning. With preprocessing,
diagonal movement is impossible.
- Since the wheel deadzone was introduced to prevent accidental scrolling
for touchpads, this filtering provides no benefit for high resolution
unidirectional mouse wheels, while causing a regression where scrolling at
least 0.125 units is required to trigger the event, causing input delay.

By adding this option, these two use cases are addressed.
2024-02-15 16:44:32 +00:00
gaesa d8f4749c34 DOCS/lua: clarify `repeatable` and `complex` for `add_key_binding`
The current documentation lacks clarity regarding the interaction
between the `repeatable` and `complex` options. Through an analysis
of the source code (`player/lua/defaults.lua` and
`player/js/defaults.js`), it was observed that the `repeatable` option
is only meaningful when the `complex` option is not enabled.
Additionally, the `complex` option in the existing documentation is
confusing, actually `fn` can be called on key repeat when `complex` is
`true` and `repeatable` is not `true`.

To address these issues, the documentation for the `repeatable` option
was updated to specify that it only applies when the `complex` option is
not set to `true`. Furthermore, the description of the `complex` and
`event` were revised to acknowledge the occurrence of key repeat events.
2024-02-15 16:43:46 +00:00
Kacper Michajłow 024e49010c m_option: fix memory leak in parse_obj_settings_list
Found by fuzzing.
2024-02-15 16:43:37 +00:00
Kacper Michajłow f413e38e42 demux_mkv: don't return null bstr with size specified
Such bstr object are not valid. Also reject empty blocks.

Found by fuzzing.
2024-02-15 16:43:37 +00:00
Kacper Michajłow 5e54a871c5 demux_mkv: error if needed compression settings were not found
Mode 3 is header stripping and we need ContentCompSettings to
reconstruct the data.

Found by fuzzing.
2024-02-15 16:43:37 +00:00
Kacper Michajłow 4419e5c41b demux_mkv: fix memory leak on invalid blocks
It is possible to have data with empty block that contains additions. In
which case the block would not be added and the additions would leak.

Found by fuzzing.
2024-02-15 16:43:37 +00:00
Thomas Weißschuh 5c252715bd ao_pipewire: add support for SPDIF formats 2024-02-15 16:43:25 +00:00
Thomas Weißschuh 790b12da89 ao_pipewire: don't interpret unknown formats
Interpreting data in the wrong sample format has unpredictable results
and may damage hardware and hurt users.
Instead error out.
2024-02-15 16:43:25 +00:00
Dudemanguy 195aa7fd96 DOCS/options: mention that sub-clear-on-seek can now break things
This is technically due to the previous commits that made subtitle
rendering more efficient by eliminating redraws, but working around this
particular edge case is useless. The sub-clear-on-seek option was
originally introduced in d5940fabcd and
specifically is a workaround for completely broken mkv files. There is
no reason to use it otherwise. Because that option disables all
duplicate checking and the previous commits rework subtitle rendering in
the still image case to be dependent on keeping track of packets, the
end result is that you will get the same line rendered multiple times.
However the important case of broken mkv files with duplicate ReadOrder
fields still work just fine with --no-video. So instead of bothering
trying to make this option "work", just clarify that stuff can break
since, again, there's no reason to use it other than as a workaround for
broken files.
2024-02-15 16:43:11 +00:00
Dudemanguy 4e5d996c3a player/sub: attempt to detect animated subtitles
The previous commits optimized sub redrawing on still images/terminal so
mpv wouldn't redraw so much. There is a gap though. It only assumes
static subtitles. Since ASS can be animated, those types of subtitles
will always need redraws so we need to build in specific detection for
this. We need to build a whitelist of events in ASS that are considered
animations and then flag the packet. Additionally, there's a bunch of
annoying bookkeeping that has to be done since packets can be dropped on
seeks and so on.
2024-02-15 16:43:11 +00:00
Dudemanguy 25bba7c811 vo_gpu_next: move the frame->redraw check for blended subtitles
Cosmetic. Since the previous commit eliminated wasteful redraws, nuke
the comment while we're at it.
2024-02-15 16:43:11 +00:00
Dudemanguy 8f043de961 player/sub: avoid wasteful subtitle redraws
This only affects two special cases: printing subtitles to the terminal
and printing subtitles on a still picture. Previously, mpv was very dumb
here and spammed this logic on every single loop. For terminal
subtitles, this isn't as big of a deal, but for the image case this is
pretty bad. The entire VO constantly redrew even when there was no need
to which can be very expensive depending on user settings.

Instead, let's rework sub_read_packets so that it also tells us whether
or not the subtitle packets update in some way in addition to telling us
whether or not to read more. Since we cache all packets thanks to the
previous commit, we can leverage this information to make a guess
whether or not the current subtitle packet is supposed to be visible on
the screen. Because the redraw now only happens when it is needed, the
mp_set_timeout_hack can be removed.
2024-02-15 16:43:11 +00:00
Dudemanguy 0a4b098c61 dec_sub: expand sub packet caching
Previously, mpv only saved a strict limit of two packets while decoding
subtitles, but it is a bit incomplete. Firstly, it's certainly possible
for there to be more than two subtitles visible at once. And also, it
did not take into account preloading. Rework this mechanism so that it
is a growable array that can store as many packets as we want. Note that
in this commit, the packets are only ever discarded on reset or destroy,
so in theory it could grow forever. Some discarding logic will be added
in the next commit since it is inherently tied to other things.
2024-02-15 16:43:11 +00:00
Kacper Michajłow 5098a27e66 vo: ensure that frames are not eaten on reconfig
This avoids clearing the queued frame and the currently displayed one on
VO reconfiguration requests that happen when new frames arrive. Instead,
let those frames be fully displayed.

Fixes mf:// playback issues introduced after commit ef11d31.

Instead of removing the frame timing check embrace and fix it to wake up
the playloop as needed. The frame display duration is problematic to
handle as both VO and playloop thread would already be sleeping, but in
certain use cases it is needed to display frames in full, so in this
case, let the VO sleep to the end of frame, wake up the core as
requested and go back sleeping.

Note that this patch series reintroduces 0c9ac5835, which is esenitally
fixed in this commit. It is still not perfect, but it is better than
just busy waiting on playloop, even if those events when this would be
needed are quite rare.
2024-02-15 16:39:58 +00:00
Kacper Michajłow a329bb546c Reapply "video: remove another redundant wakeup"
This reverts commit 44c398c3e1.
2024-02-15 16:39:58 +00:00
Kacper Michajłow 0bf4da0f5e Revert "vo: remove frame timing check from vo_still_displaying()"
This reverts commit ef11d31c3a.
2024-02-15 16:39:58 +00:00
Dudemanguy 31a5f77ceb ci/lint: add Reapply to the no prefix whitelist
You get a special award if you commit one of these.
2024-02-15 09:54:48 -06:00
der richter bba3d28781 mac/remote: simplify cover retrieval 2024-02-15 00:11:55 +01:00
der richter 45192d94d3 mac/remote: remove unnecessary nowPlayingInfo variable
no need to keep track of the nowPlayingInfo, MPNowPlayingInfoCenter
already provides the current info.
2024-02-15 00:11:55 +01:00
der richter e457cc260c mac/remote: add album and artist info 2024-02-15 00:11:55 +01:00
der richter c56be84675 mac/remote: add seek support
Fixes #11233
2024-02-15 00:11:55 +01:00
der richter 00efaeb428 mac/remote: add chapter title info 2024-02-15 00:11:55 +01:00
der richter ca8c61838e mac/remote: add media-title info
Fixes #11233
2024-02-15 00:11:55 +01:00
der richter 0a343369ba mac/remote: add playback rate info
also rate limit the position to update at max once per second.
2024-02-15 00:11:55 +01:00
der richter e23e158481 mac/remote: add duration and current position info
Fixes #11233
2024-02-15 00:11:55 +01:00
der richter 07a3bf0365 mac/remote: remove make current observer when stopped
the observer is registered on every call of the start function. this
could lead to several registered observers for the same event and
several calls to the make current function, even though we only need it
once per event.

properly remove the observer on stop, so we only ever have one observer
registered.
2024-02-15 00:11:55 +01:00
der richter de36f11fa8 mac/remote: replace command handler with generic handler function config
preparation for the upcoming changes for new functionality not related
to key handling.
2024-02-15 00:11:55 +01:00
der richter 05d0252a30 mac/remote: simplify repeatable key logic 2024-02-15 00:11:55 +01:00
der richter 0e556674dc mac/remote: move configs to initialiser for new MediaPlayer shorthands 2024-02-15 00:11:55 +01:00
der richter 1883f2f7a0 mac/remote: move class local struct and enum definition to extension
the class local struct and enum are moved to an extension to separate
their definition and usage.
2024-02-15 00:11:55 +01:00
der richter 80cde2671c mac/remote: use explicit struct instead of generic array for configs
making the config explicit gets rid of some optional unwrapping. also
rename some variables to better represent their values.
2024-02-15 00:11:55 +01:00
Mohammad AlSaleh 023d02c950 DOCS/man: more words about --teletext-page
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-02-13 10:44:41 +01:00
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