summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release 0.35.1v0.35.1release/0.35sfan52023-01-282-4/+45
|
* x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timingSultan Alsawaf2023-01-283-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PresentNotifyMSC turns out to be not only redundant, but also harmful with mesa-backed egl/glx/vulkan VOs because for all of them, mesa uses PresentPixmap behind the scenes when DRI3 is available, which already spawns a PresentCompleteNotify event when the buffer swap actually finishes. This is important because without using the timing information from these PresentCompleteKindPixmap events, there's no way for mpv to know exactly when a frame becomes visible on the display. By using PresentNotifyMSC in conjunction with DRI3-enabled mesa, two problems are created: 1. mpv assumes that a vblank won't elapse (i.e., it assumes the current MSC won't change) between the time when mesa enqueues the buffer swap and the time when mpv calls PresentNotifyMSC to ask xorg for a notification at the next MSC, relative to the current MSC at the time that xorg reads it for the PresentNotifyMSC call. This means that mpv could get a notification one or more vblanks later than it expects, since the intention here is for mpv to get a notification at the MSC that the buffer swap completes. 2. mpv assumes that a buffer swap always takes one vblank to complete, which isn't always true. A buffer swap (i.e., a page flip) could take longer than that depending on hardware conditions (if the GPU is running slowly or needs to exit a low-power state), scheduling delays (under heavy system or GPU load), or unfortunate timing (if the raster scan line happens to be at one of the last few rows of pixels and a vblank elapses just before the buffer swap is enqueued). This causes mpv to have a faulty assumption of when frames become visible. Since mpv already receives the PresentCompleteNotify events generated by mesa's buffer swaps under the hood, the PresentNotifyMSC usage is unneeded and just throws a wrench in mpv's vsync timing when xpresent is enabled. Simply removing the PresentNotifyMSC usage from the egl, glx, and vulkan VOs fixes the xpresent vsync timing.
* vo_gpu: implement VO_DR_FLAG_HOST_CACHEDsfan52023-01-246-0/+30
| | | | | | | | For OpenGL, this is based on simply comparing GL_VENDOR strings against a list of allowed vendors. Co-authored-by: Nicolas F. <ovdev@fratti.ch> Co-authored-by: Niklas Haas <git@haasn.dev>
* vo_gpu_next: implement VO_DR_FLAG_HOST_CACHEDNiklas Haas2023-01-241-0/+5
| | | | For sufficiently new versions of libplacebo.
* vd_lavc: add "auto" choice for vd-lavc-drsfan52023-01-244-6/+21
| | | | | | | | | | | | --vd-lavc-dr defaulted to "yes", which caused issues on certain hardware. Instead of disabling it, add a new "auto" value and make it the default. The "auto" choice will enable DR only when we can request host-cached buffers (as signalled by the new VO_DR_FLAG_HOST_CACHED). Co-authored-by: Nicolas F. <ovdev@fratti.ch> Co-authored-by: Niklas Haas <git@haasn.dev>
* vo: add `int flags` to the get_image signatureNiklas Haas2023-01-2412-29/+34
| | | | | This is a huge disgusting mess to thread through everywhere. Maybe I'm stupid for attempting to solve the problem this way.
* mp_image: fix XYZ primaries defaultNiklas Haas2023-01-241-4/+4
| | | | | This was incorrectly set to BT.2020, when it should be DCI-P3 for pretty much all real-world XYZ content (which is digital cinema content).
* wayland: store presentation feedbacks in a poolDudemanguy2023-01-242-20/+65
| | | | | | | | | Officially, the most cursed part of the wayland code in mpv (third or fourth try now?) This time, let's allocate a pool during init (arbitrarily set to the maximum swapchain length mpv allows, 8; don't even know if this actually works in wayland). Then we add/remove feedbacks from the pool during the lifecycle of the VO, and clean it up all at the end. Hopefully, this does the trick for good this time.
* audio: fix crash during uninit on ao_lavcDudemanguy2023-01-241-10/+12
| | | | | The buffer state can be null when using --ao=lavc, so just check it first. Fixes #10175.
* meson: also search for rst2html with .py extensionIonen Wolkens2023-01-241-1/+1
| | | | | This allows using rst2html.py from docutils if present, this was already done for rst2man.py (unneeded for rst2pdf).
* ra_d3d11: fix incorrect typesfan52023-01-241-1/+1
| | | | As it happens, `SIZE_T` and `size_t` are not the same length on 32-bit Windows
* vo_wlshm: cleanup on failureDudemanguy2023-01-241-15/+18
| | | | | If failure occurs during preinit, vo_wlshm should goto an error and cleaup itself like the other VOs.
* vulkan: fix build error for 32bit builds with clangChristoph Reiter2023-01-241-1/+1
| | | | | | | | | | | vk->surface is a handle and not a pointer, so assign VK_NULL_HANDLE. This fixes the following build error on 32bit Windows when using clang for example, which errors out when assigning a 32bit pointer to a 64bit integer: ../mpv-0.35.0/video/out/vulkan/utils.c:37:21: error: incompatible pointer to integer conversion assigning to 'VkSurfaceKHR' (aka 'unsigned long long') from 'void *' [-Wint-conversion] vk->surface = NULL; ^ ~~~~
* version.py/version.sh: bump copyright yearDudemanguy2023-01-242-2/+2
|
* demux: boost read EBU R128 gain values to ReplayGain's reference levelSimon Ruderich2023-01-241-0/+5
| | | | | | | | | | | | | Without this change the same track encoded as Opus - which requires R128 tagging - and e.g. Vorbis with ReplayGain tagging have different volumes. This is caused by ReplayGain 2 having a higher reference level of -18 dB LUFS, while EBU R128 has a lower reference level of -23 dB LUFS. For the results of gain application to match, the read EBU R128 values need to be boosted according to the difference in reference levels. Patch inspired by mpd's source code.
* wayland: initalize display_fd as -1Dudemanguy2023-01-241-3/+4
| | | | | | | | In the event of a failed wayland initalization, the display_fd is actually 0 instead of -1 which would correctly indicate it doesn't exist. Also move the fd check inside vo_wayland_dispatch_events since that function shouldn't ever do anything if we don't actually have a display fd.
* draw_bmp: ensure last slice width is less than total widthDudemanguy2023-01-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | e97819f88e451623a397b79d101497205fe849f9 corrected a special case condition that lead to an out of bounds access if the total width happened to be an integer multiple of SLICE_W (256) which could cause a crash in software VOs. However, it turns out that the functions in this file evaluate quite differently when using encoding mode (and presumably libmpv as well according to reports although I could not independently verify it). The logic here gets complicated but what ends up happening is that, in blend_overlay_with_video, the value of x + w can be greater than p->w in certain cases in encoding mode. The x is the positional value of the slice which remained unchanged from before, but w can take the full value of SLICE_W (256) which is not necessarily correct. The width of the final slice here should be the total remaining width. We can handle this in mark_rect by simply always adjusting x1 of the last slice to be equal to total width - SLICE_W * x so it can never extend beyond where it should be. In practice, this value should be the maximum allowed here. I'm not sure if the existing x1 value can possibly already be lower than SLICE_W, but just MPMIN it to be on the safe side. Fixes #10908.
* vo: hwdec: fix drmGetDeviceNameFromFd2() related memory leakrepojohnray2023-01-241-1/+5
| | | | | This commit fixes a minor memory leak related to drmGetDeviceNameFromFd2(). This function returns a string allocated with strdup().
* hwdec_drmprime: fix memory leakrepojohnray2023-01-241-0/+1
|
* ao_coreaudio: use AudioUnitReset as ao_driver.reset to prevent long restartLi Chang2023-01-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [motivation] Seeking on MacOS appears to be lagged when users connect to wireless audio output (airpods for example). This commit attempts to fix mpv-player/mpv#10270 [observation] 1. When using other media player (VLC to be exact) simultaneously, the lagging on seek disappear. We could guess that the AudioDevice is on some sort of "warm-up" state. See mpv-player/mpv#9243 for detailed description. 2. `AudioOutputUnitStart` takes significant longer time after each seek or pause/play when using wireless output devices compares to wired devices. [rationale] After investigate codes in ao_coreaudio.c, it appears that the the `stop` function was used as `ao_driver.reset` function. Therefore every seek and pause would call `AudioOutputUnitStop`. It turns out that `ao_driver.reset` function is used in `ao_reset`. And `ao_reset` function is used to clean up the state of current `ao` so I think `AudioUnitReset` is more proper than `AudioOutputUnitStop` under this semantics. Since ao_coreaudio use pull base mechanism, audio playback behaviors upon pause/seek could be handled by callback function (streaming silence when paused) so there is no need to stop AudioUnit when resetting. Therefore using `AudioUnitReset` as `ao_driver.reset` looks proper. Additionally, after using proper reset, the AudioUnit that represents hardware I/O devices doesn't need to be restart everytime seek/pause actions happen. Restarting wireless devices simply takes longer in MacOS which is the root cause of lagging observed by users when they seek or pause/play media. [method] Use `AudioUnitReset` for ao_driver.reset.
* vo_opengl: do not blindly reject all Microsoft's OpenGL implementationsKacper Michajłow2023-01-241-3/+3
| | | | | | | | | | | | | This change enables mpv to work in the WSL2 (WSLg) environment where OpenGL is implemented on top of D3D12. This reverts commit 149d98d244. Mentioned OpenGL implementation (GDI Generic) in the original change will be rejected by version check, so there is no need to handle it manually. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* external_files: set log level for potential files to traceNicolas F2023-01-241-1/+1
| | | | | | | | | | We ask users to freely share log files with us, which is usually okay, unless a user has some unrelated and potentially embarrassing files in their working directory. These would show up in the debug level message output that --log-file enables. Change the listing of potential external files to trace log level, to save the users and the developers the embarrassment.
* hwdec/d3d11va: fix a possible memory leakchen702023-01-241-0/+1
|
* filter_kernels: fix kaisergaramond132023-01-241-1/+1
| | | | Seems to me that params[1] is set to NAN and here should be the same value as in params[0].
* ao_pipewire: clean up when hotplug_init failsThomas Weißschuh2023-01-241-1/+2
|
* ao_pipewire: destroy context on connection failureThomas Weißschuh2023-01-241-0/+1
|
* ao_pipewire: free properties on failureThomas Weißschuh2023-01-241-2/+4
|
* ao_coreaudio: use device's nominal sample rate for latency propertiesrcombs2023-01-241-1/+9
| | | | | | Fixes sync issues when using high-latency devices at non-native sample rates Closes #10984
* wayland: check for resize/move in touch event firstDudemanguy2023-01-241-8/+9
| | | | | | | | | | | | | | | 8300830951e2b0b90b22fc7d33b7556ed05e139c rearranged/simplified some of the wayland touch code mainly because what was there before was completely broken on my machine in those days (dragging was unreliable, resizing was really buggy, etc.). However, one user said that touch input no longer worked for him after that change. I could not ever reproduce it, but it seems the issue was putting down the key before testing for resize/move in the code. Now who knows why this actually matters, but apparently it works for the user in question and I don't observe any unexpected behavior on my end when swapping the order. Like the mouse/pointer code, we also now do a test for dragging before actually trying a resize/move which is a little more consistent than before. Fixes #9771.
* osc: don't spam window-controls bindings on every renderDudemanguy2023-01-241-3/+9
| | | | | | | | | | | | | | | Not sure when this actually started happening, but it's probably been like this for years. Currently, the logic for the window-controls works by simply checking if the osc is visible and then either enabling or disabling the associated keybindings. The problem is that this can just constantly spam mp.enable_keybindings/disable_key_bindings on every single render call if the user disables the border at any point in time. This does a lot of pointless work and also results in the logs being spammed with lines like "disable-section". Clearly, this should just work like the code for checking the input keybindings just above it. Keep track of an internal state variable and check when it doesn't match the osc visibility. In that case, we can then either enable or disable the key bindings and just update the variable.
* ao_pipewire: log sample queueingThomas Weißschuh2023-01-241-0/+2
| | | | | | | This allows us to more easily see the datapath from mpv to pipewire. We know how often the callbacks are triggered, how big the buffers are and how much data mpv provides to pipewire.
* meson: fix stdatomic detection on bsdDudemanguy2023-01-241-3/+4
| | | | | | | BSDs use compiler-rt instead of libatomic for atomic types. In this case, we can handle it similar to how dl is detected. Check for the library (allowing for it to fail), and then check for a header symbol while linking latomic. Fixes #10906.
* lcms: fix validate_3dlut_size_optNiklas Haas2023-01-241-4/+1
| | | | | Not only was this function needlessly convoluted, it was also broken - since it returned a bool value where an error code was expected.
* lcms: always parse lcms2-related optionsNiklas Haas2023-01-241-40/+34
| | | | | | | | | | | | | | Currently, the lcms-related options are only defined when lcms2 is enabled at build time. However, this causes issues (e.g. segfault) for vo_gpu_next, which relies on the presence of these options (to forward them to libplacebo). (That libplacebo internally depends on lcms2 as well is an implementation detail - compiling mpv *without* lcms against libplacebo *with* lcms should be possible in principle) Fixes: #10891 Closes: #10856
* meson: unbreak dl check on BSDs without libdlDudemanguy2023-01-241-1/+1
| | | | | | Regression from 1835dfc05c8298262dbf8e08a31d61bbfecdb30b. The actual libdl dependency is not always required for the function symbol check. Fixes #10901.
* meson: prepend MPV_CONFDIR path with prefixDudemanguy2023-01-241-1/+1
| | | | | | | | | | | | | | Meson uses the sysconfdir option for setting the global config directory. This conveniently defaults to /etc if the prefix is set to /usr which is nice for linux distros. BSDs tend to use /usr/local which causes this value to become 'etc' by default which is not an absolute path so you would need to set something like -Dsysconfdir=/usr/local/etc as well in the configuration step. It turns out we can have our cake and eat it too by just joining the paths of prefix and sysconfdir together. In the case where -Dprefix=/usr, this still results in /etc/mpv as the path since the path joining logic just drops the leading '/usr/'. For the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This fixes #10882.
* vo_gpu_next: fix undefined behavior on alpha-first formatsNiklas Haas2023-01-241-1/+4
| | | | | | | When the alpha channel is the first component, this code block gets skipped by the continue, meaning the check for c==0 never passes. Fix it by explicitly keeping track of whether bits have been set.
* wayland: also log refresh rate on surface entranceDudemanguy2023-01-241-2/+2
| | | | | Never bothered to log this for some reason, but it's pretty convenient when debugging.
* wayland: error out if essential protocol support is missingDudemanguy2023-01-243-0/+36
| | | | | | | | | | | | | | Related issue: #10868. While most protocols are in theory optional, a small amount of them are absolutely essential and nothing will work without them. We should make sure to error out in those cases and not try to actually do anything. For wayland support in general, wl_compositor support is obviously required. If there is no wl_surface, you can't do anything. Additionally, vo_wlshm quite obviously requires wl_shm so mark that one as well. vo_dmabuf_wayland needs linux_dmabuf, viewporter, wl_shm, and wl_subcompositor. In practice, these are all very standard protocols and shouldn't be missing but the linked issue above is at least one example where a compositor was stuck on an ancient version of a wayland interface.
* ao_pipewire: log version information and metadataThomas Weißschuh2023-01-241-0/+13
|
* Release 0.35.0v0.35.0sfan52022-11-122-87/+96
|
* meson: fix macos-touchbar checkDudemanguy2022-11-111-9/+5
| | | | | | | | Apparently, it is possible for touchbar.m to compile on non-macos machines. Also, the disable switch didn't actually work either. Fix this by using the require() function and making sure that Cocoa (should be apple-only) is found in addition to the compile check passing which is what waf does. Fixes #10847.
* github/workflows: force deletion of existing upstream python symlinks on macOSJan Ekström2022-11-111-0/+5
| | | | | | | | | | This way each time a new Python version is installed via Homebrew , we don't get CI failures due to the upstream Python distribution also being installed. Ref: actions/runner-images#6459 Ref: actions/runner-images#6507 Ref: actions/runner-images#2322
* vo_gpu_next: add tunable shader parametersNiklas Haas2022-11-115-1/+69
| | | | | | | | | | | This is a very simple but easy way of doing it. Ideally, it would be nice if we could also add some sort of introspection about shader parameters at runtime, ideally exposing the entire list of parameters as a custom property dict. But that is a lot of effort for dubious gain. It's worth noting that, as currently implemented, re-setting `glsl-shader-opts` to a new value doesn't reset back previously mutated values to their defaults.
* vo_gpu: mark --gamma-factor and --gamma-auto with deprecation warningssfan52022-11-101-2/+4
| | | | This was forgotten in commit 2207236aaae54f32c1861c6fd77219e28139dc78.
* wayland, x11: fix possibly unsafe bstr usagesfan52022-11-102-3/+3
| | | | | | In practice this never led to any issues due to implementation details of bstr_sanitize_utf8_latin1, but there's no guarantee that a bstr is correctly null-terminated.
* ao_pipewire: reload ao on stream disconnectThomas Weißschuh2022-11-071-0/+5
| | | | | | | | This allows the core of mpv to know about issues in the AO. Otherwise playback will just freeze as no more data callbacks are sent by PipeWire. Also it allows mpv to try to reconnect the AO or find another, working AO.
* ao_pipewire: explicitly remove stream hookThomas Weißschuh2022-11-071-0/+2
| | | | | | We want to add more logic to the stream event handler. This logic should not be triggered during normal stream shutdown, so we remove the listener beforehand.
* ao_pipewire: log generic stream errorsThomas Weißschuh2022-11-071-0/+17
|
* Revert "ao/audiounit: include AVAudioSession buffer in latency calc"Aman Karmani2022-11-071-1/+1
| | | | This reverts commit 8b114e574abd08892612e21e784ea1872e1adf8c.
* vo_dmabuf_wayland: improve error handling exporting VA surfaceAaron Boxer2022-11-071-23/+25
| | | | | 1. check for all error conditions when calling vaExportSurfaceHandle 2. only clean up valid descriptors
* hwdec_vaapi: only set VADisplay resource if entire init process has succeededAaron Boxer2022-11-071-4/+4
| | | | | This resource is used by dmabuf_waland to decide if it should manage vaapi buffers, so it should not be set if vaapi init has failed
* github/workflows: remove seccomp disablementJan Ekström2022-11-051-4/+0
| | | | | | | Workflow virtual machines have now been updated so that moby package contains rule for the newly added syscalls, such as 'clone3'. Effectively reverts 64fa440c697b9b8e96e14e33f7e79c6674c5b1a3 .
* github/workflows: bump linux jobs to Ubuntu 22.04 base VMJan Ekström2022-11-051-1/+1
| | | | | These utilize a custom docker container in any case, but this brings us to consistency with the mingw-w64 jobs.
* github/workflows: move all build jobs to checkout V3Jan Ekström2022-11-051-3/+3
| | | | | mingw-w64 has utilized this for a while so might as well make it consistent.
* github/workflows: remove xcode 13.0 to xcode 13.1 overrideJan Ekström2022-11-051-10/+0
| | | | | | | Thankfully, this version is no longer the default on any of the macOS runners. Effectively reverts a76527772eb52084c61241b89cfb42ce59f6f6a4 .
* github/workflows: remove macOS 10.15 image usageJan Ekström2022-11-051-1/+0
| | | | | | | | | This older image has been deprecated and will be removed in December. The images have also already had planned outages during which the CI flow has been affected. Thus it feels like a good idea to clean this up at this point. Ref: actions/runner-images#5583
* sd_ass: never mangle colours on RGB videoOneric2022-11-051-1/+2
| | | | | | | It turns out, even xy-VSFilter and XySubFilter do not mangle colours if the video is native RGB regardless of the sub's YCbCr header. libass' docs were also updated to reflect this.
* meson: move dmabuf-wayland specific files under the right checkDudemanguy2022-11-031-3/+3
| | | | | This doesn't need to be under the generic wayland check, but the dmabuf-wayland one. Matches the waf build.
*