summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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 Langdale2023-01-061-0/+1
| | | | | | | | When I refactored the code here to stop using stack allocated AVPackets, I forgot to assign `dp->buffer` after initialising the AVPacket. Fixes #11097
* version.py/version.sh: bump copyright yearDudemanguy2023-01-042-2/+2
|
* demux: boost read EBU R128 gain values to ReplayGain's reference levelSimon Ruderich2023-01-041-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: dispatch and wait for compositor events in uninitDudemanguy2023-01-032-30/+25
| | | | | | | | | | Similar to some other issues we've had with unprocessed compositor events. When quitting mpv, there's two things we should be doing: dispatching any last minute wayland events and then waiting for a compositor reply. Luckily, there's already an internal helper for this (renamed to wayland_dispatch_events for consistency) that we can use. All of the special casing of wl->feedback becomes unneccesary and we can remove this from vo_wayland_state with this method. Fixes #110022.
* wayland: initalize display_fd as -1Dudemanguy2023-01-031-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.
* wayland: consistently employ use_presentDudemanguy2023-01-031-4/+1
| | | | | | | | | We have a use_present bool that keeps track of whether or not to use presentation time. However, the creation of the feedback listener actually wasn't checking this and was instead checking for the existence of wl->presentation. There's no point in always creating the listener and feedback if mpv isn't actually going to use it. Just change it to use_present instead.
* draw_bmp: ensure last slice width is less than total widthDudemanguy2023-01-031-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-021-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-021-0/+1
|
* ao_coreaudio: use AudioUnitReset as ao_driver.reset to prevent long restartLi Chang2023-01-021-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łow2022-12-301-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>
* demux: add --demuxer-hysteresis-secs option to save power with cachingSultan Alsawaf2022-12-303-3/+42
| | | | | | | | | | | | | | | | | | | | | | Buffering ahead nonstop into the cache results in nonstop disk or network activity to read stream data from wherever it may originate. Currently, there's no way to configure the demuxer to back off once it's buffered ahead enough data, since the cache limit will be perpetually not-reached as a stream continues to play, until the entire stream is eventually buffered. On a laptop with an i9-12900H with decoding performed by the iGPU, watching a locally-saved 1080p video which hasn't been buffered into the page cache consumes approximately 15 W even with caching enabled. When configuring a hysteresis to make the demuxer back off, power consumption drops to 9 W when watching the same video, resulting in a whopping 6 W of power savings. To make it possible to attain significant power savings via caching, add a --demuxer-hysteresis-secs option to configure a hysteresis to make the demuxer back off until there's only the configured number of seconds remaining in the cache from the current playback position. This feature is disabled by default.
* external_files: recognize webp files as cover artRon Shabi2022-12-291-0/+8
| | | | | | | | | | | | | mpv currently only recognizes jpg and png files named "AlbumArt", "Album", "cover", etc. which are in the same folder as the audio files as album/cover art and displays it when playing such audios. This feature adds support for webp files following the same naming scheme to be displayed as cover art for albums who have them. Webp variations are lower in priority compared to jpg or png files. Resolves: #11006
* x11: add modesetting to the xpresent whitelistSultan Alsawaf2022-12-271-1/+2
| | | | | | | | | | | | | | | | Since the modesetting driver now has TearFree support with integration into xpresent, it's important that xpresent is used with the modesetting driver to get the correct vsync timing when a frame is delayed by one vblank interval due to a pending page-flip enqueued by a different entity. The modesetting driver ensures that the xpresent extension reports the correct presentation timing when TearFree is used; mpv just needs to listen to it. Add the modesetting driver to the xpresent whitelist so mpv can get the correct presentation completion timing when modesetting TearFree is used. This is also helpful for when xpresent performs page flips directly in the modesetting driver and a natural delay in the display pipeline causes a page flip to be delayed by one vblank interval or more.
* build: add configure test for POSIX shm for the sake of vo_kittysfan52022-12-263-4/+15
| | | | Android's POSIX coverage is pretty sketchy but not like we have a choice.
* demux: replace deprecated usage of stack allocated AVPacketsPhilip Langdale2022-12-242-24/+45
| | | | | | | | | | | | | In the previous change, I replaced the callsites that used `av_init_packet`, but there are a handful of places that use stack allocated packets with no initialisation. In one case, I just switched to heap allocation as it's only done once per stream at most. In the other case, I removed our usage of the AVPackets as a convenience mechanism to transfer data into a heap allocated packet. Instead, I inlined the data copying.
* audio: reset pull AO at end of fileThomas Weißschuh2022-12-221-1/+1
| | | | | | | | | | When a pull AO reaches reaches EOF then ao_read_data() will set p->playing = false. Because the ao is marked as not playing ao_set_pause(true) will not reset the AO. This keeps the output stream unintentionally open. Fixes #9835
* vo_kitty: Introduce modern sixel alternativeMia Herkt2022-12-216-0/+480
| | | | | | | | | | | | | See https://sw.kovidgoyal.net/kitty/graphics-protocol/ This makes no attempt at querying terminal features or handling terminal errors, as it would require mpv to pass the response codes from the terminal to the vo instead of interpreting them as keystrokes made by the user and acting very unpredictably. Tested with kitty and konsole. Fixes #9605
* external_files: set log level for potential files to traceNicolas F2022-12-211-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 leakchen702022-12-211-0/+1
|
* filter_kernels: fix kaisergaramond132022-12-201-1/+1
| | | | Seems to me that params[1] is set to NAN and here should be the same value as in params[0].
* man/vo: TypoMia Herkt2022-12-201-1/+1
|
* man/vo: Correct --vo-sixel-bufferedMia Herkt2022-12-201-2/+3
|
* vo_sixel: Implement write() loopMia Herkt2022-12-201-4/+16
| | | | | Not all systems are Linux. Also update the comment to better reflect POSIX documentation.
* vo_sixel: Rename draw-clear -> config-clearMia Herkt2022-12-203-8/+9
|
* osdep/terminal.h: Rename screen buffer controlsMia Herkt2022-12-203-6/+6
| | | | SAVE/RESTORE were a bit misleading.
* vo_sixel: Alias/deprecate exit-clear -> alt-screenMia Herkt2022-12-203-10/+18
| | | | Also update documentation to reflect actual behavior.
* vo_sixel: Make buffering optionalMia Herkt2022-12-203-13/+36
| | | | It can be slower than unbuffered.
* man/vo: Fix rendering error due to non-printablesMia Herkt2022-12-201-1/+1
|
* DOCS/interface-changes: Add --vo-sixel-draw-clearMia Herkt2022-12-201-0/+1
|
* Revert "ao_pipewire: deactivate stream at end of playback"Philip Langdale2022-12-191-14/+0
| | | | This reverts commit b5373079f20aeeba8ac80e773f3cc05692dbb51f.
* vo_sixel: Buffer full output sequenceMia Herkt2022-12-191-19/+27
| | | | | This allows the VO to write its output without interference from other processes or threads.
* vo_sixel: Use write(2) on POSIX platformsMia Herkt2022-12-191-14/+35
|
* vo_tct: Use newer options APIMia Herkt2022-12-191-28/+24
|
* vo_sixel: Move user options to structMia Herkt2022-12-191-69/+66
|
* vo_sixel: Add option to skip clear while drawingMia Herkt2022-12-192-7/+15
|
* osdep/terminal: Move common esc codes to terminal.hMia Herkt2022-12-193-42/+40
|
* vo_sixel: Use the alternate buffer to restore termMia Herkt2022-12-191-4/+6
|
* vo_tct: Use the alternate buffer to restore termMia Herkt2022-12-191-3/+7
|
* ao_pipewire: deactivate stream at end of playbackThomas Weißschuh2022-12-181-0/+14
| | | | | | | By explictly shutting down the stream pipewire can deactivate the used hardware, saving CPU and power. Fixes #9835
* ao_pipewire: clean up when hotplug_init failsThomas Weißschuh2022-12-121-1/+2
|
* ao_pipewire: destroy context on connection failureThomas Weißschuh2022-12-121-0/+1
|
* ao_pipewire: free properties on failureThomas Weißschuh2022-12-121-2/+4
|
* vd_lavc: Set AV_HWACCEL_FLAG_UNSAFE_OUTPUT flagPhilip Langdale2022-12-121-0/+11
| | | | | | | | | | This new hwaccel flag was added to allow us to request that an hwaccel decode not implicitly copy output frames before passing them out. The only hwaccel that would implicitly copy frames is nvdec due to how it has a small output pool that cannot be grown very much. However, we already copy frames as soon as we get our hands on them (in our hwdec) so we're already safe from pool exhaustion, and the extra copy doesn't help us.
* hwdec_drmprime: support yuv420p formatEmperorPenguin182022-12-102-0/+6