summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ci: migrate MSYS2 build to GitHub ActionsKacper Michajłow2023-01-285-116/+120
|
* wscript: remove MSVC from compiler lookupKacper Michajłow2023-01-281-0/+3
| | | | | MSVC is not supported and waf doesn't respect CC environment value like any sane buildsystem.
* meson: reuse libmpv objects for cplayerThomas Weißschuh2023-01-261-10/+13
| | | | | | | When building both cplayer and libmpv in the same build previously all sources were built twice. By reusing the objects from libmpv in cplayer we can thus save 50% percent of the build steps.
* ao_pipewire: align thread name with general conventionsThomas Weißschuh2023-01-251-1/+1
|
* audio: simplify implementation of property ao-volumeThomas Weißschuh2023-01-2510-81/+42
| | | | | | | | | | | | | | ao-volume is represented in the code with a `struct ao_control_vol_t` which contains volumes for two channels, left and right. However the code implementing this property in command.c never treats these values individually. They are always averaged together. On the other hand the code in the AOs handling these values also has to handle the case where *not* exactly two channels are handled. So let's remove the `struct ao_control_vol_t` and replace it with a simple float. This makes the semantics clear to AO authors and allows us to drop some code from the AOs and command.c.
* stream/dvb: remove some unused variablesDudemanguy2023-01-241-3/+0
| | | | Missed in b6b83805183618f3a46f2cc77d85dcff72ef6396.
* x11: remove PresentNotifyMSC from egl/glx/vulkan to fix xpresent timingSultan Alsawaf2023-01-253-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.
* wayland: add wp-fractional-scale-v1 supportDudemanguy2023-01-249-17/+137
| | | | | | | | | | | | | This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes #9443.
* wayland: rewrite geometry and scaling handlingDudemanguy2023-01-246-39/+31
| | | | | | | | | This is in preparation for fractional scaling support. Basically, redo all the coordinates in wayland so that wl->geometry is equal exactly to what is being put out to the screen (no extra wl->scaling multiplication required). The wl->vdparams variable is also eliminated for simplicity. This changes mpv's behavior on wayland with hidpi scaling but that will be addressed in more detail with the next commit.
* vo_gpu: implement VO_DR_FLAG_HOST_CACHEDsfan52023-01-236-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-231-0/+5
| | | | For sufficiently new versions of libplacebo.
* vd_lavc: add "auto" choice for vd-lavc-drsfan52023-01-234-6/+19
| | | | | | | | | | | | --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-2312-29/+34
| | | | | This is a huge disgusting mess to thread through everywhere. Maybe I'm stupid for attempting to solve the problem this way.
* msg: log-file set at mpv.conf: don't ignore early messagesAvi Halachmi (:avih)2023-01-232-11/+80
| | | | | | | | | | | | | | | | | Previously, if log-file was set not via a CLI option (e.g. set via mpv.conf or other config file, or set from a script init phase), then meaningful early log messages were thrown away because the log file name was unknown initially. Such early log messages include the command line arguments, any options set from mpv.conf, and possibly more. Now we store up to 5000 early messages before the log file name is known, and flush them once/if it becomes known, or destroy this buffer once mpv init is complete. The implementation is similar and adjacent, but not identical, to an existing early log system for mpv clients which request a log buffer.
* msg: log-file buffer size: don't use magic number (no-op)Avi Halachmi (:avih)2023-01-231-1/+3
|
* drm: rewrite based around vo_drm_stateDudemanguy2023-01-2112-1178/+956
| | | | | | | | | | | A longstanding pain point of the drm VOs is the relative lack of state sharing. While drm_common does provide some sharing, it's far less than other platforms like x11 or wayland. What we do here is essentially copy them by creating a new vo_drm_state struct and using it in vo_drm and context_drm_egl. Much of the functionality that was essentially duplicated in both VOs/contexts is now reduced simple functions in drm_common. The usage of the term 'kms' was also mostly eliminated since this is libdrm nowadays from a userspace perspective.
* mp_image: fix XYZ primaries defaultNiklas Haas2023-01-211-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).
* meson: skip some unneeded macos-specific checksDudemanguy2023-01-201-23/+24
| | | | | A couple of programs were always unconditionally searched for, but we don't have to do this if we're not on darwin.
* meson: drop feature plain-glThomas Weißschuh2023-01-191-2/+1
|
* ci: run meson testsThomas Weißschuh2023-01-194-0/+4
|
* meson: limit vaapi checksThomas Weißschuh2023-01-191-3/+3
|
* meson: don't add libmpv and cplayer features to conf_dataThomas Weißschuh2023-01-191-3/+4
| | | | | | | Core code should not use these features as it would mean that a libmpv build could change an mpv executable and vice-versa. Also changing one of them should not force a full recompile of the other one through a change to config.h.
* meson: remove dependency from libmpv to plain-glThomas Weißschuh2023-01-191-2/+2
| | | | | | | | The libmpv feature should not have any impact on the built core code. Otherwise a mpv executable compiled in a build together with libmpv has different features than one from a build without. The gl feature doesn't hurt, so always enable it.
* meson: add simple test executable for libmpvThomas Weißschuh2023-01-192-0/+32
| | | | This can be used to make sure that the built libmpv is functional.
* stream: remove trailing NULL element from stream listThomas Weißschuh2023-01-171-4/+3
|
* hwdec_cuda: drop support for PL_HANDLE_WIN32_KMTNiklas Haas2023-01-172-35/+17
| | | | | | | | | | | | | | | This handle type was only needed for backwards compatibility with windows 7. Dropping it allows us to simplify the code: there is no longer a need for runtime checks, as the handle type can now be statically assigned based on the platform. The motivating usecase here, apart from code simplification, is a desired switch to timeline semaphores, which (in the CUDA API) only supports the non-KMT win32 handles. It's worth pointing out that we need no runtime check for IsWindows8OrGreater(), because the `export_caps.sync` check will already fail on versions of windows not supporting PL_HANDLE_WIN32.
* wayland: only warn when actually missing idle inhibit supportThomas Weißschuh2023-01-161-5/+6
|
* vo: make driver list staticThomas Weißschuh2023-01-161-1/+1
|
* vo: remove trailing NULL element from driver arrayThomas Weißschuh2023-01-161-3/+2
|
* ao: remove trailing NULL element from driver arrayThomas Weißschuh2023-01-161-4/+3
|
* DOCS/compile-windows.md: update with meson instructionsLaserEyess2023-01-151-33/+34
| | | | | | No need to encourage waf here. Note: minor edits by Dudemanguy to update some dead links and such.
* build: officially deprecate wafDudemanguy2023-01-153-2/+7
| | | | | | | | While the waf build has served us well for many years, it's time to officially consider it deprecated. The meson build was added fully with the intention to eventually replace waf and its current state is more than good enough to do that. Let's start the deprecation period now to give users a heads up to switch before we remove waf for good.
* TOOLS/lua/autoload: improve alphanumeric sortingChristoph Heinrich2023-01-151-4/+4
| | | | | | | | | | | | | | | Currently filenames like `EP.1.v0.1080p.mp4` do not get sorted correctly (e.g. episode 11 right after episode 1). That is caused by the `.` in front of the episode number, making it get sorted as if it were decimals. The solution is to match the whole real number or integer instead of matching the integer part and the fractional part separately. This will regress sorting of numbers with multiple commas where the length of the individual segments differs between filenames. Since those are rather uncommon, that is unlikely to be a problem (for anyone ever).
* wayland: store presentation feedbacks in a poolDudemanguy2023-01-132-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.
* Revert "wayland: dispatch and wait for compositor events in uninit"Dudemanguy2023-01-132-22/+27
| | | | | | | | | | | This ended up being a bad idea. The problem is that it introduces ordering when destroying events (something we weren't worried about before) and Lynne pointed out a problem with the callback not also being destroyed before the surface in IRC. Just undo this and go with a different approach (next commit). P.S. the wayland_dispatch_events name change is kept though because I like that better. This reverts commit aa8ddfcdf30c4ffb38f3ec5d6663bbabf0b7b4df.
* TOOLS/docutils-wrapper: make executable + alphabetizeDudemanguy2023-01-132-1/+1
| | | | | | I should have caught this during review but the feature was too cool and I didn't really pay attention (sorry). For consistency with the rest of the scripts here.
* audio: fix crash during uninit on ao_lavcDudemanguy2023-01-131-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-131-1/+1
| | | | | This allows using rst2html.py from docutils if present, this was already done for rst2man.py (unneeded for rst2pdf).
* various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriatesfan52023-01-1221-35/+35
| | | | | | | | In debug mode the macro causes an assertion failure. In release mode it works differently and tells the compiler that it can assume the codepath will never execute. For this reason I was conversative in replacing it, e.g. in mpv-internal code that exhausts all valid values of an enum or when a condition is clear from directly preceding code.
* various: replace if + abort() with MP_HANDLE_OOM()sfan52023-01-1216-48/+24
| | | | | MP_HANDLE_OOM also aborts but calls assert() first, which will result in an useful message if compiled in debug mode.
* stream/dvb: drop support for DVB API before 5.8sfan52023-01-123-208/+14
| | | | | There is really no reason to keep the #ifdef mess around given that version is available since December 2012 (Linux 3.7).
* ao_audiotrack: replace malloc with tallocsfan52023-01-121-6/+1
|
* stream/cookies: use stream_read_file()sfan52023-01-123-60/+21
| | | | No need for this redundant implementation.
* {video,audio}: adjust unsafe strncpy usagessfan52023-01-122-3/+3
|
* video/x11: replace sprintf usagesfan52023-01-121-1/+1
|
* video: replace sprintf usagesfan52023-01-122-2/+2
|
* demux_mf: replace unsafe string functionssfan52023-01-121-4/+3
|
* ra_d3d11: fix incorrect typesfan52023-01-121-1/+1
| | | | As it happens, `SIZE_T` and `size_t` are not the same length on 32-bit Windows
* DOCS: clarify wid casting on Windowssfan52023-01-121-2/+3
| | | | | | | | | | The situation here is that HWND is always a 32-bit value but the win32 API also accepts sign-extended values as valid. The trouble starts when the numeric value is negative, as mpv ignores those. Apparently this only happens after a while (related to uptime or number of handles created), which meant this problem was rare. addresses #10189
* vo_dmabuf_wayland: drop support for linux-dmabuf-v2Dudemanguy2023-01-123-35/+2
| | | | | | | | | The only real reason this was ever supported is because it was dramatically simpler than v4, so it was put in as an initial implementation. Later, v4 support was added and we left v2 for compatibility, but let's just drop it. Compositors all use v4 nowadays, and v2 is significantly limited (no modifier support for example). It's better to just remove this dead code for simplicity.
* vo_dmabuf_wayland: support panscan and panningAaron Boxer2023-01-111-1/+38
|
* ta/README: update link to talloc documentationMax Dunbar2023-01-101-1/+1
|
* vo_wlshm: properly support video panscanDudemanguy2023-01-091-0/+6
| | | | | Turns out it was already doing this under the hood the entire time. The only catch is that the vo just needed a resize.
* player: don't force saving start in watch-later-optionsDudemanguy2023-01-094-6/+15
| | | | | | | | | | | | The watch-later mechanism has always unconditionally wrote start to files to save the playback position. When this was later expanded to watch-later-options, this logic was kept in place. But we don't actually have to unconditionally write this and can allow users to remove the option from the list if they want to. The start value still requires some special handling; it should always be written if possible regardless of the value changing. However, we can just place it within the default set of options for watch-later-options so it can be removed like any other.
* player: add video-sync=display-tempoChristoph Heinrich2023-01-096-10/+37
| | | | | | | | So far there was no way to sync video to display and have audio sync to video without changes in pitch. With this option the audio does not get resampled (pitch change) and instead the corrected audio speed is applied to audio filters.
* player: choose speed of smallest acceptable factor for display syncChristoph Heinrich2023-01-091-16/+13
| | | | | | Instead of choosing based on smallest deviation from set speed, use the speed change from the smallest factor that does not exceed `video-sync-max-video-change`.
* TOOLS/lua/autoload: optimize performance of natural sortingChristoph Heinrich2023-01-091-5/+10
| | | | | | Formatting the string on each comparison is wasteful. Formatting strings beforehand and then comparing the already formatted ones leads to a huge performance gain.
* TOOLS/lua/autoload: further optimize the natural sortingdyphire2023-01-091-35/+19
| | | | | | | | | | | | | Commits https://github.com/mpv-player/mpv/commit/257dbdf06feb366f9eb1f96ceb7026c9365dddaa uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: https://github.com/jonniek/mpv-playlistmanager/commit/3cf323f3c419af77f4141119283c1ec2911491c5 Closes https://github.com/mpv-player/mpv/issues/8969
* wayland: make vo_wayland_reconfig a boolDudemanguy2023-01-084-10/+4
| | | | | | This was already returning true/false but the type was int. Also simplify a few places in the wayland contexts where we can just return the value of this function instead of doing redundant checks.
* wayland: cleanup on vo_wayland_init errorDudemanguy2023-01-083-13/+12
| | | | | | Instead of just returning true/false, it's better to have this function cleanup itself. We can eliminate some redundant uninit calls elsewhere in the code as well.
* vo: change vo_platform_init to boolDudemanguy2023-01-088-15/+14
| | | | | | | | There's several functions that are used for initializing mpv on a certain platform (x11, wayland, etc.). These currently are all int, but they actually return 1 and 0 like a boolean. This gets a bit confusing because actual vo preinit functions return 0 and -1 instead. Just make these all bool instead and return true/false to make it clearer.
* vo_wlshm: cleanup on failureDudemanguy2023-01-081-15/+18
| | | | | If failure occurs during preinit, vo_wlshm should goto an error and cleaup itself like the other VOs.
* vo_dmabuf_wayland: goto err instead of returningDudemanguy2023-01-081-11/+11
| | | | | Returning early is clearly wrong. It should use to goto to cleanup after itself. Also renamed from error_out to err for purely comestic reasons.
* vulkan: fix build error for 32bit builds with clangChristoph Reiter2023-01-081-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; ^ ~~~~
* meson: dynamically compute dependencies for manpage and html buildThomas Weißschuh2023-01-082-2/+68
| | | | | | | | | This allows us to rebuild the manpages and html documentation only when necessary. It is not necessary to manually keep the list of dependencies up to date. Unfortunately rst2pdf does not yet support this feature, see https://github.com/rst2pdf/rst2pdf/issues/1108
* TOOLS/umpv: support shell-quotes in $MPVsfan52023-01-071-1/+2
|
* demux: new packet should not point to source buffer when copying dataPhilip Langdale2023-01-061-1/+0
| | | | | | | In `new_demux_packet_from`, we initialise a new packet and allocate a buffer which we copy the source data into. But I was then assigning the original source pointer as the packet's buffer, rather than keeping the newly allocated one. Whoops.
* demux: actually initialise packet buffer when creating new packetPhilip Langdale