summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* osxbundle: fix syntax warning with python 3.12der richter2024-02-241-3/+3
|
* meson: add custom target for macOS App bundlingder richter2024-02-241-0/+8
| | | | Fixes #10879
* ao_wasapi: scale queried AO volume to (0, 100)sunpenghao2024-02-241-2/+2
| | | | This was done for `AOCONTROL_SET_VOLUME` but not `AOCONTROL_GET_VOLUME`.
* ao_wasapi: address premature buffer fills in exclusive modesunpenghao2024-02-242-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, running AO control wakes up the WASAPI renderer thread in the `WASAPI_THREAD_FEED` state, where `thread_feed` will be called. However, it seems that in recent Windows versions (tested on Windows 10 build 19044.3930 and Windows 11 build 22631.3007) we can't know if it is safe to feed more audio data in event-driven exclusive mode: - `IAudioClient_GetCurrentPadding` always returns `bufferFrameCount`, even if *NO* data has ever been written. This means we don't know how much free space we have that is available for writing. This is not the case in shared mode, where the return value correctly reflects the size of data waiting to be processed. As a sidenote, MS did not document the precise definition of the return value for an event-driven, exclusive stream [1]. - `IAudioRenderClient_GetBuffer` never fails. We can call it for 10 times in a roll, each time requesting an entire buffer (the unit at which data is exchanged in exclusive mode using event-driven buffering; there are 2 such buffers) and get a successful return code everytime. In shared mode, we get `AUDCLNT_E_BUFFER_TOO_LARGE` if we request a buffer larger than that currently available. As a result, `thread_feed` will always write `bufferFrameCount` frames of audio in exclusive mode. There will therefore be glitches each time `thread_control` is called due to the subsequent `thread_feed` overwriting frames yet to be processed. Also, an irreversible error is accumulated to `sample_count` as long as there is no AO reset, leading to eventual, unbounded A/V desync. As a fix to the issue, add a dedicated state for dispatch queue processing so that `thread_feed` is only called when signaled by the OS. The buffer checks in `thread_feed` that use `GetCurrentPadding` in exclusive mode are kept in case there are older versions where the two APIs behave differently. Closes #12615. [1] https://learn.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-getcurrentpadding
* player: fix watch later config comments when ignoring pathGuido Cella2024-02-241-2/+5
| | | | | | | | | | | | | With --ignore-path-in-watch-later-config, --write-filename-in-watch-later-config still writes the absolute path of files in the comment, even though the hash is calculated from the basename. Make it write the basename to avoid confusion. Also stop writing redirect entries for parent directories with --ignore-path-in-watch-later-config, both because it's redundant, and because with this patch it would write the basename of directories in the comment, which would be wrong because their hashes are calculated from the absolute paths.
* player/loadfile: rewrite sub autoselection logicDudemanguy2024-02-242-51/+29
| | | | | | | | | There's too many dumb options related to subtitles which have annoying edge cases. Try to rewrite this completely so it hopefully behaves normally in every expected scenario. A key goal here is be smarter while looping through the tracks and avoid selecting the subtitle if it doesn't meet user's passed options as opposed to clearing the pick after the fact. Fixes #13280 and fixes #13263.
* github/workflows: update cross-platform-actions to v0.23.0Kacper Michajłow2024-02-231-2/+2
| | | | | - Use hardware accelerated virtualization on Linux runners - Update to FreeBSD 14.0
* command: fix sub-seek while paused without a videoGuido Cella2024-02-232-0/+9
| | | | | | | When using sub-seek without a video track while paused, adding the 0.01 SUB_SEEK_OFFSET to the new timestamp is not enough to show the new subtitle line. Add 0.1 instead to fix it. 0.01 is already enough for sub-step.
* command: don't add SUB_SEEK_OFFSET twice with sub-seekGuido Cella2024-02-231-4/+0
| | | | | The name SD_CTRL_SUB_STEP is misleading, but it is also used for sub-seek, and sub/sd_ass.c already adds SUB_SEEK_OFFSET with it.
* options/path: move path utility functions to misc/path_utilsnanahi2024-02-236-224/+287
| | | | | These utility functions have nothing to do with user and config dir/file. Move them to a separate file.
* osdep/io: move I/O utility functions to misc/io_utilsnanahi2024-02-237-59/+115
| | | | | | | The purpose of osdep/io is to provide a wrapper for POSIX I/O functions on Windows. The last 2 functions are utility functions which don't serve this purpose. Move them to a separate file.
* osdep/io: ignore 'x' mode for mp_fopennanahi2024-02-231-2/+1
| | | | | | fopen() with 'x' mode is a non-portable glibc extension, is currently unused, and should not be used in order to maintain POSIX compatibility. Thus there is no need for the Windows wrapper mp_fopen() to support it.
* vo_gpu: fix fragment coordinate calculation when ditheringnanahi2024-02-221-3/+5
| | | | | | | | | | | | When doing the dithering pass, the fragment coordinate is queried, but doesn't take the fbo texture flipped property into account. This results in different dithering patterns when toggling between fbo flipped and non-flipped state. This can be reproduced with --vo=gpu --gpu-api=opengl and easily seen with --dither-depth=1 when toggling between playing and pausing. Fix this by flipping the fragment y coordinate if the fbo is flipped when calculating dithering coordinate.
* vo_gpu: fix fragment coordinate calculation when drawing checkerboardnanahi2024-02-221-1/+3
| | | | | | | | | | | | | | When redrawing cached frames while the fbo texture is flipped, the texture after drawing to screen pass will be flipped when blitting. However, when rendering the checkerboard, the fragment coordinate doesn't take this into account, so the coordinate before flipping is used, resulting in different checkerboard location when toggling between flipped and non-flipped state. This can be reproduced with --vo=gpu and --gpu-api=opengl: the checkerboard patterns when playing and pausing are different (vertically flipped). Fix this by flipping the fragment y coordinate if the fbo is flipped when calculating checkerboard coordinate.
* x11_common: handle window dragging in ButtonPress eventnanahi2024-02-212-28/+17
| | | | | | | | | | | | | | | Begin the _NET_WM_MOVERESIZE window dragging in ButtonPress event to match the behavior of win32 and wayland, simplify logic by dropping the win_drag_button1_down hack required by the old method, and fix a race condition described in commit 19f101db680f966a6e56035a16784541be390982, which happens when moving the mouse and releasing the button at the same time. The race condition can be easily triggered when using a touch screen (tested with libinput driver), where a tap is translated to MotionNotify, ButtonPress, MotionNotify, and ButtonRelease in sequence, with the last 2 events having the same timestamp. This has caused some window managers to not stop dragging after the ButtonRelease, resulting in window being stuck in dragging state after a single tap.
* various: make mentions of macOS consistentder richter2024-02-2112-16/+16
| | | | | change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc consistent. use the official naming macOS.
* DOCS: make mentions of macOS consistentder richter2024-02-215-5/+5
| | | | | change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc consistent. use the official naming macOS.
* DOCS/man: document Ctrl+WHEEL_UP/WHEEL_DOWN keybindsnanahi2024-02-211-2/+4
| | | | Also remove the existing redundant wordings.
* input.conf: bind Ctrl+WHEEL_UP/DOWN to video-zoomnanahi2024-02-211-0/+2
| | | | | | | | | | | | | | | | | | | There are good reasons to bind Ctrl+WHEEL_UP/WHEEL_DOWN to video-zoom: - They are ubiquitous and familiar key bindings to represent zooming operations, which are used in all popular web browsers, document viewers, and document editors. - Because WHEEL_UP/WHEEL_DOWN are scaled with high-resolution scrolling input devices like touchpads, this allows smooth zooming. - This makes "pinch to zoom" with touchpads and touchscreens work out of box on Windows, since by default applications receive these key inputs for pinch gesture. - It had been considered to bind these keys to window-scale instead. However, this results in horrible UX as the keybinds work only when the mouse pointer is over the mpv window, and if the window shrinks during this operation, the window below mpv now receives these keybinds, resulting in unwanted zooming for that window, which violates the principle of least surprise.
* DOCS/mpv: update ancient profiles config examplellyyr2024-02-201-11/+13
| | | | | Hopefully actually useful now. Also updates big-cache to not be smaller than the current default.
* osxbundle: add optional source path argumentder richter2024-02-201-9/+11
|
* osxbundle: remove old version retrieval fallbackder richter2024-02-201-4/+3
|
* osxbundle: bundle vulkan driver and layersder richter2024-02-201-0/+72
| | | | | | | only bundle synchronization2 layer for older vulkan/MoltenVK versions where it is needed. Fixes #13232
* vo: make libmpv last in the auto-probing order for cocoa-cb onlyder richter2024-02-204-3/+12
| | | | | | | | | | | | | | | | | | | | this partially reverts commit 7b5a258. back then the only properly working vo on macOS was cocoa-cb (libmpv). it would always use the deprecated opengl cocoa backend or no vo at all. because of that libmpv was moved to the top of the auto-probing order, so the preferred vo was used on macOS only. we now have a working vulkan gpu/gpu-next backend on macOS which should be the new default vo. though disabling the auto-probing again for libmpv would probably cause the undesired behaviour on macOS that cocoa-cb would never be auto selected again. especially if not build with vulkan support or without vulkan driver on macOS, this would lead to no video output at all. so instead of completely reverting the mentioned commit, we instead move libmpv to the bottom of the auto-probing order but only auto select it when mpv was built with cocoa-cb support. this restores the previous behaviour on all other platforms besides macOS, but also lets us auto select cocoa-cb if supported.
* encode_lavc: don't use deprecated `avcodec_close`llyyr2024-02-191-1/+1
| | | | Deprecated upstream https://github.com/FFmpeg/FFmpeg/commit/1cc24d749569a42510399a29b034f7a77bdec34e
* af_lavcac3enc: don't use deprecated `avcodec_close`llyyr2024-02-191-1/+9
| | | | | | | | Deprecated upstream https://github.com/FFmpeg/FFmpeg/commit/1cc24d749569a42510399a29b034f7a77bdec34e We need to reallocate the context here because `avcodec_free_context` also frees the context, and we want to reuse the context with some reconfig.
* wayland_common: update pointer serial on pointer_enterJulian Orth2024-02-181-0/+1
|
* cocoa-cb: lock CGLContext on uninit and manual redrawder richter2024-02-182-0/+12
| | | | | | | | | | | | this fixes a crash on quit, when a CATransaction from a system owned thread/event is happening at the same time. locking the context synchronises these access and prevents the race condition. the draw operation induced by any display call from the CAOpenGLLayer doesn't need that lock, since the display function already does lock that current context. Fixes #11681
* github/workflows: switch back to luajit for macosDudemanguy2024-02-181-1/+1
| | | | | | | | | | | | | | | | Homebrew finally pulled the plug on lua 5.1*, and it is no more. So we have to change to a different lua package and the only other choice is luajit (no 5.2 in homebrew). We used to use luajit for the ci, but 649556b2b65207c0d40751fae941223978b04932 switched it to lua 5.1. As explained there, luajit 2.0 was horribly bugged and not usuable for mpv and the build had to do dumb hacks to work around it. I expected 5.1 to last a bit longer than a couple of years, but luckily it seems like luajit in homebrew now pulls a luajit 2.1 version (some rolling release thing or however upstream works). The details don't really matter for us since 2.1 does not have all the awful issues that 2.0 used to have. So just switch to luajit again. *: https://github.com/Homebrew/homebrew-core/commit/57d73df3ba924c870f4b6d36080e7cb37275367e
* vo_gpu_next: fix some lut-related memory leaksDudemanguy2024-02-171-0/+5
|
* vo_gpu_next: move gpu-next opts to specific sub optionDudemanguy2024-02-173-52/+65
| | | | | | | This matches the general workflow in the codebase. We keep a cache of these new options and update them if needed. Fixes #13481 and fixes #11518.
* vo: remove VOCTRL_SET_EQUALIZER and simplify into UPDATE_VIDEODudemanguy2024-02-177-41/+1
| | | | | | | | | | | | | | | Since 03cf150ff3516789d581214177f291d46310aaf4, the only purpose of this VOCTRL was to signal a redraw to the vo. It actualy could have been removed in 531868fe0d2a35fbbff78d9a9ff8f96df73e69fd, but this was missed. The UPDATE_VIDEO flag is better anyway because it allows us to handle a wide variety of options scattered around that require the VO to update itself and redraw. We can remove both of the custom callbacks in vo.c and only leave the VOCTRL_VO_OPTS_CHANGED one. Additionally, that commit also introduced vo_set_want_redraw, but this is redundant and not needed. The VOs that use VOCTRL_UPDATE_RENDER_OPTS already set vo->want_redraw, and those are the only VOs where these options are relevant in the first place. So we can remove this as well and just let the big callback in player/command do everything.
* wayland_common: drop shape device check when spawning cursornanahi2024-02-172-12/+2
| | | | | | It's only necessary to check the existance of cursor_shape_manager. Also drop the pointer check to handle multi-seat since a removed seat sets the cursor_seat to NULL.
* wayland_common: properly determine has_keyboard_inputnanahi2024-02-172-5/+14
| | | | | Track has_keyboard_input per seat and consider mpv having keyboard input if at least one seat has keyboard input.
* wayland_common: handle scroll accumulation for each seatnanahi2024-02-172-22/+20
| | | | | Since it's needed to determine whether an axis event has axis_value120, do this per seat to avoid interference between seats.
* wayland_common: handle keyboard state per seatnanahi2024-02-172-45/+43
| | | | | Avoids modifiers from mulitple seats from interfering with each other and messing up xkb states.
* wayland_common: set cursor visibility for all seats for voctrlnanahi2024-02-171-3/+22
| | | | | | For VOCTRL_SET_CURSOR_VISIBILITY, set cursors visibility for all seats. The return is VO_NOTAVAIL is none of the seats have cursor, and VO_FALSE if setting visibility failed for at least one seat.
* wayland_common: handle removal of seatsnanahi2024-02-171-2/+13
|
* wayland_common: prevent cursor_seat stale referencenanahi2024-02-171-0/+1
| | | | Set it to NULL on vo uninit.
* wayland_common: handle cursor_shape_device per seatnanahi2024-02-172-29/+31
| | | | | | The cursor_shape_device is per pointer, which is per seat. Handle it together with other seat objects. This in turn also handles cursor visibility per seat.
* wayland_common: drop unnecessary xdg_toplevel null checknanahi2024-02-171-11/+1
| | | | | The vo init already fails if xdg_toplevel creation fails, so these checks after the vo is initialized is unnecessary.
* wayland_common: implement multi-seat supportnanahi2024-02-172-91/+141
| | | | | | | | | | | | | | | | | | | | On a multi-seat setup, wl_registry_global advertises wl_seat multiple times, one for each seat. if wl->seat is already set, the previous value will be overwritten, preventing it from being freed. Additionally, if the latter seat doesn't have the capabilities of the former seat, the keyboard/pointer/touch input devices will be destroyed because the current wl_seat_capabilities doesn't distinguish between different seats. This casues keyboard/pointer/touch not working if the latter seat has no such capabilities. Fix this by implementing multi-seat support. This allows receiving inputs from all devices on all seats. All seat-specific objects (wl_keyboard/pointer/touch, wl_data_device) are grouped with their respective seats so they can be managed together. Note that currently inputs from all seats are interleaved with each other and modify the same global input states.
* wayland_common: indentation nitnanahi2024-02-171-1/+1
|
* vulkan/context_win: make --alpha work and runtime changeablenanahi2024-02-171-6/+15
| | | | | | If libplacebo manages to create a vulkan swapchain that allows alpha composition mode to be controlled by the DWM API, this makes it runtime changeable.
* opengl/context_win: make --alpha runtime changeablenanahi2024-02-171-8/+13
| | | | | Same as d3d11, but since SetPixelFormat can be only called once, cAlphaBits in PIXELFORMATDESCRIPTOR must be set to make this work.
* d3d11: make --alpha runtime changeablenanahi2024-02-171-6/+12
| | | | | The DWM compositor transparency API is runtime changeable. Handle this in update_render_opts.
* opengl/context_win: make --alpha=yes worknanahi2024-02-171-0/+5
| | | | | | | | Specify cAlphaBits in PIXELFORMATDESCRIPTOR makes the pixel format transparent, as is already the case for d3d11. Also makes the window transparent when --alpha=yes is used. Works on --vo=gpu and --vo=gpu-next.
* d3d11: set window to transparent if --alpha=yes is specifiednanahi2024-02-171-0/+3
| | | | | This makes --alpha=yes work with d3d11 and --d3d11-flip=no. transparent window doesn't work with flip model swapchain by design.
* w32_common: add function to control window transparency statenanahi2024-02-172-0/+22
| | | | Use the DWM API to enable and disable compositor transparency.
* command: add window-id to MPV_EVENT_VIDEO_RECONFIG property changeDudemanguy2024-02-171-2/+2
| | | | | | | | | 25b66256d7ff48254b2055a066e29f260414112f 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.
* DOCS/man: add description of display-names property for waylandnanahi2024-02-161-1/+4
| | | | | | 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.
* vo_gpu_next: don't add 0 width/height sub bitmaps to pl_overlayDudemanguy2024-02-161-0/+2
| | | | | | 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.
* osdep/threads-posix: fix headers for OpenBSD buildJose Maldonado aka Yukiteru2024-02-151-0/+5
| | | | | In OpenBSD the compilation fail because osdep/threads-posix.h need include pthread_np.h
* DOCS: document --input-preprocess-wheel optionnanahi2024-02-152-0/+15
| | | | | | 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.
* input: add --input-preprocess-wheel optionnanahi2024-02-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | This adds --input-preprocess-wheel option, which can be used to control whether to preprocess received wheel events. Commit 937128697fbbef6b21e2d23a4785f1334f62b9e3 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.
* DOCS/lua: clarify `repeatable` and `complex` for `add_key_binding`gaesa2024-02-151-5/+6
| | | | | | | | | | | | | | | | 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.
* m_option: fix memory leak in parse_obj_settings_listKacper Michajłow2024-02-151-3/+10
| | | | Found by fuzzing.
* demux_mkv: don't return null bstr with size specifiedKacper Michajłow2024-02-151-0/+6
| | | | | | Such bstr object are not valid. Also reject empty blocks. Found by fuzzing.
* demux_mkv: error if needed compression settings were not foundKacper Michajłow2024-02-151-0/+4
| | | | | | | Mode 3 is header stripping and we need ContentCompSettings to reconstruct the data. Found by fuzzing.
* demux_mkv: fix memory leak on invalid blocksKacper Michajłow2024-02-151-4/+6
| | | | | | | 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.
* ao_pipewire: add support for SPDIF formatsThomas Weißschuh2024-02-151-15/+46
|