summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ci: update libs used by mingw buildsfan52021-10-072-4/+5
|
* github/workflows: enable macOS 11.x CIJan Ekström2021-10-061-0/+1
| | | | This image has finally become public.
* vo_gpu: libplacebo: add missing includeNiklas Haas2021-10-041-0/+1
| | | | | This was removed from common.h upstream since it was a cyclic dependency. We need to re-import it into utils.h manually.
* vo_gpu: libplacebo: drop conditional code paths for old versionsNiklas Haas2021-10-043-34/+1
| | | | No longer needed with the bump to v3.104.
* vo_gpu: libplacebo: drop code deprecated in libplacebo v3Niklas Haas2021-10-043-13/+2
| | | | | This is only needed for back-compat with libplacebo v2, and will break due to upstream removal starting with libplacebo v4.
* wscript: bump libplacebo minimum versionNiklas Haas2021-10-041-1/+1
| | | | Switching to v3 allows us to drop the use of deprecated/removed members.
* options: add missing dash in msg-level help messageEmil Velikov2021-10-031-1/+1
| | | | | | | | Currently using mpv --msg-level=help, shows an instance of --msglevel (missing dash). Seems like the help message was only partially updated with the -msglevel -> --msg-level transition. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* osc.lua: avoid infinite ticks loop on idleAvi Halachmi (:avih)2021-10-031-1/+11
| | | | | | | | | | | | | | | Before this commit, animation-end was handled at render(), however, it's not called on idle, which resulted in state.anitype ~= nil, with nothing to reset it during idle, which caused in an infinite tick() loop (starts on first mouse move). Now tick resets the animation on idle, and also, as a safety measure, if we're past 1s after the animation deadline. The safety measure is because the osc states are complex, and it's easier to detect a "we really shouldn't be animating now" at tick() itself rather than detecting the exact states where animation should be reset. Generally, the safety mmeasure is not needed.
* osc.lua: unify animation reset function (no-op)Avi Halachmi (:avih)2021-10-031-6/+8
|
* build: lua 5.1/5.2: use generic version namesAvi Halachmi (:avih)2021-10-032-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR: use --lua=XXX for pkg-config name XXX, e.g. --lua=lua-5.1 . For unversioned 'lua.pc', use the name luadef51/luadef52 . Autodetection remains the same (5.2 names, luajit, 5.1 names). The old names are still supported, but not auto-detected. Before this patch, if one wanted to choose a specific lua version when more than one is installed, then the names were a mess, e.g. 51obsd is also the name detected on Arch linux, and other (distro) names are also not unique to a specific distro/platform. So to ask mpv to choose the package name (specifically, the pkg-config file name), one needs to look at the mpv sources and find the (arbitrary) distro name which has the same lua version naming as they do on their own system, e.g. --lua=51obsd on Arch. This is a pain. Now we add generic names: - luadef51/luadef52 - generic pkg-config lua.pc (version is inside). - lua* - exactly the pkg-config name, e.g. --lua=lua-51 for lua-51.pc (the names are curated, e.g. --lua=foo won't detect foo.pc). - The legacy names (e.g. 51deb) are still supported, but undocumented, and the new generic names take precedence during auto-detection. The fact that the generic names all start with "lua" has an additional benefit that it shows right after "lua" at the output of mpv -v, while the old names start with numbers, so they're first at the list, making it hard to understand that e.g. "51obsd" is the lua version. None of these names are actually used at the mpv code. The C code checks the version using the lua headers (LUA_VERSION_NUM).
* build: lua version: sanitize id before storage (no-op)Avi Halachmi (:avih)2021-10-032-3/+5
| | | | | | | | | | | | | | | | | | | | | | The lua version names which are autodetected/chosen (such as "51deb") are used for two things: - as key for storing the pkg-config compile/link flags. - as ID for config.h and elsewhere - they're sanitized to use "_". Due to some inconsistensies, if the sanitized ID is different than the original name, then the compile/link flags are stored with the original name as key, while the retrieval happens with the sanitized ID - and therefore fails to find the correct flags. The solution is to use the original name only for display purpose at the output of configure, while using the sanitized version for everything else, so that storage and retrieval use the same key. Currently there's no issue and the patch has no effect, because the sanitizer considers all the current names as valid IDs. However, the next commit will add names which the sanitizer modifies, such as "lua-5.1", so this commit makes such names work too.
* Revert "player: add track-list/N/image sub-property"Jan Ekström2021-10-0210-53/+14
| | | | | | | | Unfortunately, this functionality in large part based on a struct member that was made private in FFmpeg/FFmpeg@7489f632815c98ad58c3db71d1a5239b5dae266c in May. Unfortunately, this was not noticed during review. This reverts commit 0862664ac952d21fef531a8923a58ae575268fc5.
* github/workflows: disable seccomp for linux native CIJan Ekström2021-10-021-0/+4
| | | | | | | | | | This CI builder bases on openSUSE Tumbleweed, and recently had its glibc updated. This led to new syscalls such as 'clone3' not being allowed through the security layer. Can be reverted after Github Actions updates their security policy. actions/virtual-environments#3812
* player: add track-list/N/image sub-propertyGuido Cella2021-10-0210-14/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This exposes whether a video track is detected as an image. This is useful for profile conditions, property expansion and lavfi-complex, and is more accurate than any detection even Lua scripts can perform, since they can't differentiate between images and videos without container-fps and audio and with duration 1 (which is the duration set by the mf demuxer with the default --mf-fps=1). The lavf demuxer image check is moved to where the number of frames is available for comparison, and is modified to check the number of frames and duration instead of the video codec. This doesn't misdetect videos in a codec commonly used for images (e.g. mjpeg) as images, and can detect images in a codec commonly used for videos (e.g. 1-frame gifs). pix files are also now detected as images, while before they weren't since the condition was checking if the AVInputFormat name ends with _pipe, and alias_pix doesn't. Both nb_frames and codec_info_nb_frames are checked because nb_frames is 0 for some video codecs (hevc, av1, vc1, mpeg1video, vp9 if forcing --demuxer=lavf), and codec_info_nb_frames is 1 for others (mpeg, mpeg4, wmv3). The duration is checked as well because for some uncommon codecs and containers found in FFMpeg's FATE suite, libavformat returns nb_frames = 0 and codec_info_nb_frames = 1. For some of them it even returns duration = 0, so they are blacklisted in order to never be considered images. The extra codecs that would have to be blacklisted without checking the duration are AV_CODEC_ID_4XM, AV_CODEC_ID_BINKVIDEO, AV_CODEC_ID_DSICINVIDEO, AV_CODEC_ID_ESCAPE130, AV_CODEC_ID_MMVIDEO, AV_CODEC_ID_NUV, AV_CODEC_ID_RL2, AV_CODEC_ID_SMACKVIDEO and AV_CODEC_ID_XAN_WC3, while the containers are film-cpk, ivf and ogg. The lower limit for duration is 10 because that's the duration of 1-frame gifs. Streams with codec_info_nb_frames 0 are not considered images because vp9 and av1 have nb_frames = 0 and codec_info_nb_frames = 0, and we can't rely on just the duration to detect them because they could be livestreams without an initial duration, and actually even if we could for these codecs libavformat returns huge negative durations like -9223372036854775808. Some more images in the FATE suite that are really frames cut from a video in an uncommon codec and container, like cine/bayer_gbrg8.cine, could be detected by allowing codec_info_nb_frames = 0, but then any present and future video codec with nb_frames = 0 and codec_info_nb_frames = 0 would need to be added to the blacklist. Some even have duration > 10, so to detect these images the duration check would have to be removed, and all the previously mentioned extra codecs and containers would have to be added added to the blacklists, which means that images that use them (if they exist anywhere) will never be detected. These FATE images aren't detected as such by mediainfo either anyway, nor can a Lua script reliably detect them as images since they have container-fps and duration > 0 and != 1, and you probably will never see files like them anywhere else. For attached pictures the lavf demuxer always set image to true, which is necessary because they have duration > 10. There is a minor change in behavior for which audio with attached pictures now has mf-fps as container-fps instead of unavailable, but this makes it consistent with external cover art, which was already being assigned mf-fps. When the lavf demuxer fails, the mf one guesses if the file is an image by its extension, so sh->image is set to true when the mf demuxer succeds and there's only one file. Even if you add a video's file type to --mf-type and open it with the mf protocol, only the first frame is used, so setting image to true is still accurate. When converting an image to the extensions listed in demux/demux_mf.c, tga and pam files are currently the only ones detected by the mf demuxer rather than lavf. Actually they are detected with the image2 format, but it is blacklisted; see d0fee0ac33a. The mkv demuxer just sets image to true for any attached picture. The timeline demuxer just copies the value of image from source to destination. This sets image to true for attached pictures, standalone images and images added with !new_stream in EDL playlists, but it is imperfect since you could concatenate multiple images in an EDL playlist (which should be done with the mf demuxer anyway). This is good enough anyway since the comment of the modified function already says it is "Imperfect and arbitrary".
* DOCS/javascript.rst: clarifications (file_info, custom init)Avi Halachmi (:avih)2021-09-301-2/+5
|
* js: custom init (~~/.init.js): fail loudly on errorsAvi Halachmi (:avih)2021-09-301-3/+3
| | | | | | | | | | | | Previously, loading ~~/.init.js was inside a try block, in order to quietly ignore errors if the file doesn't exist. However, that also prevented any real errors from showing up even when the file does exist, and the script continued as if everything is OK, while in fact the custom init script didn't complete correctly. Now we first check if the file exists, and then load it without try/catch, so that any error shows up normally (and abort the script).
* wayland: further xdg-decoration/border refinementsDudemanguy2021-09-282-26/+40
| | | | | | | | | | | | The value of the border option should always match what the actual state of the window is. Previously if a compositor rejected the request by mpv, it did not correct itself. Also add some code to keep track of decoration requests. Anytime the state is changed, make the last saved request again (doesn't hurt and seems like intuitive behavior). Unfortunately, this isn't foolproof since options only send callback if the value is changed. (ex. on sway if the floating window has no border, and then is titled, setting the border value to "yes" does nothing since tiling the window already set the border value to "yes").
* vo_rpi: fix DISPMANX_UPDATE_HANDLE_T leakHo Ming Shun2021-09-281-3/+4
| | | | | | | | | | | | | | | Fixes handle leak that happened whenever tvservice callback was invoked. Powering on the TV causes HDMI unplug and attached events to be sent to the tvservice callback. This meant you could only power on/off your TV a finite number of times before you were unable to allocate additional resources from VideoCore (usually resulting in a "Could not get DISPMANX objects." error). Furthermore because the VideoCore kernel driver does not cleanup handles when a process dies, the only way to recover from the leak was to reboot the RPI.
* ytdl_hook.lua: search for yt-dlp by defaultGuido Cella2021-09-252-21/+53
| | | | | | | | | | | Because youtube-dl is inactive and the yt-dlp fork is becoming more popular, make mpv use yt-dlp without any extra configuration. yt-dlp is ordered before youtube-dl because it's more obscure, so users who have yt-dlp installed are more likely to want to use it rather than youtube-dl. Fixes #9208.
* stream/dvbin: remove "full-featured" API includesNicolas F2021-09-221-2/+0
| | | | | | | | | | | | In Linux kernel commit 819fbd3d8ef36c09576c2a0ffea503f5c46e9177 these two header files were moved to staging (though they've since been moved out again by Linus.) We do not actually use this, and it's in a state of maybe-removal from the kernel as of Linux 5.14. Get rid of it; mpv still builds fine without it, so it wasn't needed anyways. Fixes #9233.
* demux_mkv: enable AVCodec parser timestamp usage for parsed audioDan Oscarsson2021-09-211-0/+4
| | | | | | | | | Without this, cases where the parser cannot return data right away will end up utilizing the following fed packet's timestamps. This will in turn cause an unnecessary offset in the audio stream timestamps. An example of such buffered parser in libavcodec is the EAC3 one.
* win32: Windows 10: timeBeginPeriod on demandAvi Halachmi (:avih)2021-09-213-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | Before this commit, timeBeginPeriod(1) was set once when mpv starts, and the timers remained hi-res till mpv exits. Now we do the same as before on Windows version < 10. On Windows 10+ we now use timeBeginPeriod if needed, per timeout. To force a mode regardless of Windows version, set env MPV_HRT: - "always": the old behavior - hires timers as long as mpv runs. - "perwait": sets 1ms timer resolution if timeout <= 50ms. - "never": don't use timeBeginPeriod at all. It was observed that on Windows 10 we lose about 0.5ms accuracy of timeouts with "perwait" mode (acceptable), but otherwise it works well for continuous timeouts (one after the other) and random ones. On Windows 7 with "perwait": continous timeouts are accurate, but random timeouts (after some time without timeouts) have bad accuracy - roughly 16ms resolution instead of the requested 1ms. Windows 8 was not tested, so to err on the side of caution, we keep the legacy behavior "always" by default.
* waftools/features: add forgotten enable variants for enabled featuresJan Ekström2021-09-202-4/+5
| | | | | | | | | This brings enabled features on the same level as disabled and auto-detected features by having both alternatives available. Looking at the commit message of 652895abdce4bc1ff2f00c7f21c0d0d722680806 this seems to have been the intent from the start, but this specific definition was missing from the option creation in Features.
* wayland: report correct window size when maximizedDudemanguy2021-09-131-2/+7
| | | | | | | | | In wayland_common, wl->window_size keeps track of the window's size when it is not in the fullscreen or maximized state. GET_UNFS_WINDOW_SIZE is meant to report the size except for when it is fullscreen (hence UNFS). However, the actual function was merely returning the wl->window_size so it was wrong for maximized windows. Workaround this by returning wl->geometry instead when we have the maximized case. Fixes #9207.
* build: enable strict FFmpeg ABI compatibility by defaultJan Ekström2021-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its define (HAVE_FFMPEG_STRICT_ABI) is now utilized in a single location, where an internal libavformat struct member is utilized. This struct member is now (after around 10 years) finally removed from public visibility in FFmpeg's master. After a review of functionality, the information in bytes_read is passed onto the demuxer layer, and then utilized for {cache,hack}_unbuffered_read_bytes. This information is then utilized for: 1. Calculation of bytes_per_second in demux/demux.c::update_cache, which fills the information for properties "cache-speed" as well as "raw-input-rate" (of which stats.lua is the most prominent user). 2. bytes_per_second also affects how often update_cache is called in addition to the two locations it is called unconditionally in (read_packet, demux_update). In other words, the information provided does not appear to control crucial mpv functionality, but rather its lack would seem to mostly affect the speed of certain properties updating, or having valid values. For the former, stream size as well as timed metadata get updated in update_cache - although the demux layer does throttle the update of certain things to once per second in that function. For the latter, "cache-speed" and "raw-input-rate" lose read data statistics from AVIOContexts opened by the opened FFmpeg AVFormatContext itself, as opposed to the primary one - which goes through mpv's stream reading implementation. By enabling this feature, and disabling this abuse of private API lets users build mpv by default with the latest master FFmpeg, thus giving us the breathing room to look into some of the details of this case, and either decide to: 1. Post a patch to add this information back to FFmpeg proper. 2. Remove or replace this functionality in another manner. End user impact: Any IO not handled by mpv itself - but rather by IO contexts newly opened by the input format - is not visible through the properties "cache-speed" and "raw-input-rate". Examples of such input formats are the HLS and DASH readers in FFmpeg. Historical git references: - Addition of unbuffered_read_bytes: 4dfaa373846e79f1bc34b50426c1584b948c0eb6 - Rework to have the reporting function: ebf183eeec388d87a19415ee01970b21b6ef6832 Fixes #9159
* input.conf: remove redundant commentsGuido Cella2021-09-061-25/+25
|
* demux_playlist: extend maximum line size (again) to 2MAvi Halachmi (:avih)2021-09-061-1/+1
| | | | | | | | | | | | | | | | | | Last time it was extended was de3ecc60 from 8K to 512K two years ago. The issue currently is that youtube EDL files can get very big. Size of about 520K (one line), was observed, at the time of writing: mpv https://youtube.com/watch?v=DBzFQgSMHdQ --ytdl-format=299 ytdl_hook.lua is unaffected by this because EDL lists don't go through the file reader at demux_playlist.c (where each line was limited to 512K before this commit), however, EDL files on disk which are loaded with --playlist=file.edl do. Increase the limit to 2M so that such EDL files can also be loaded from disk. Fixes #9186
* win32: initial position: center with bordersAvi Halachmi (:avih)2021-09-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Previously, the initial positioning and fit ignored the borders, and centered the content (the video itself) at the working area. Now, the initial positioning centers the window, by subtracting the borders (if needed) from the target area for the initial fit/position. While this does mean that the initial maximum content area is now smaller than before, ultimately this has no impact on the window size, because fit_on_screen is called later and, if needed, further shrinks the window to fit the borders too - but without centering the window. So the net impact of this commit is only the initial positioning (same size as before), which now centers the window instead of the content. Note that on Windows 10 the borders include invisible areas at the sides and bottom of the window (for mouse edge-drag), so visibly the window is nearer to the top than to the bottom, but these are the metrics we have (fit_on_screen uses the same border size values). On Windows 7 it looks perfectly centered.
* win32: fix incorrect application of --monitoraspectAvi Halachmi (:avih)2021-09-061-1/+4
| | | | | | | | | | | | | The --monitoraspect value is calculated at vo_calc_window_geometry2 (VCWG2) or VCWG3, and applied via vo_apply_window_geometry. Before this commit, the screen size which the win32 VO used with VCWG2 was the working area (screen minus taskbar). This allows better fitting, but breaks the pixelaspect calculation which is derived from the --monitoraspect value and this rectangle. VCWG3 allows an independent size for the aspect calculations, and now we use it independently of the fit size.
* win_state: add vo_calc_window_geometry3Avi Halachmi (:avih)2021-09-062-5/+21
| | | | | | | | | | | | | | | | | vo_calc_window_geometry2 (VCWG2) calculates both the pixelaspect and the autofit sizes based on one "screen" rectangle. However, these two calculations might need two different "screen" rects if the fit should take into account decorations and/or taskbar etc, while pixelaspect should be based on the full (monitor) rect. VCWG3 does just that. It's the same as VCWG2, but with an additional monitor rect which is used exclussively to calculate pixelaspect, while the "screen" argument is used for fitting (like before). VCWG2 now uses/calls VCWG3 with the same screen and monitor rects. Currently yet unused.
* bash completion: Allow completions to work without external functionsArthur Williams2021-09-051-4/+3
| | | | | | | | | | If bash_completion wasn't installed, _filedir wouldn't be defined which led to all filename-based completions to error out. Specifically autocompletion would fail when a filename was expected and when bash_completion wasn't installed. Now we fall back to `compgen -f` if _filedir fails. According to _filedir's comments, compgen doesn't handle files with spaces well, but it is still better to complete most files than none.
* DOCS/options: fix minor typo in compute shadersNicolas F2021-08-291-1/+1
| | | | This "bw" should most likely be a "be".
* wayland: set default cursor size to 24Ivan2021-08-281-1/+1
| | | | | Set it to 24 if it couldn't be read frome $XCURSOR_SIZE for some reason. Since it seems to be the default value for most distros/DE.
* wayland: read XCURSOR_THEME to get cursor themeIvan2021-08-281-1/+2
| | | | | Read $XCURSOR_THEME environment variable if set and if not then fall back to "default" (/usr/share/icons/default and ~/.icons/default)
* vo_tct: add resize capabilityCloud116652021-08-261-0/+7
| | | | No performance penalty added by getting the terminal size every frame.
* vo_drm: fix typo in error messagea13460542021-08-261-1/+1
|
* DOCS: use upstream license filesa13460542021-08-252-22/+21
| | | | | | | The current files contain weird formatting characters, new files obtained from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
* DOCS: fix spellinga13460542021-08-245-7/+7
|
* DOCS: fix spelling in github issue templatesa13460542021-08-245-5/+5
|
* input.conf: remove bindings of removed propertiesGuido Cella2021-08-191-2/+0
| | | | angle was removed in a9d83eac40, and program in a75b249b0b.
* input.conf: add commentsGuido Cella2021-08-191-132/+122
| | | | These will be shown in the new keybinding list.
* terminal-unix: identify and ignore unknown CSI sequencesAvi Halachmi (:avih)2021-08-191-0/+11
| | | | | | | | | | | | | | | If an unknown ESC sequence is detected where an ASCII char <X> follows the ESC, mpv interprets it as ALT+<X>, which is the traditional terminal encoding of ALT+letter. However, if <X> is '[' then it's a CSI sequence which continues after the '[', and has its own termination rules (can be many chars). Previously, mpv interpreted unknown CSI sequences as (incorrect) ALT+[ followed by (incorrect) "keys" from the rest of the sequence. In this commit, if a unknown CSI sequence is detected, mpv ignores exactly the complete sequence.
* command: cycle: respect the prefix "repeatable"Avi Halachmi (:avih)2021-08-192-1/+7
| | | | | | | | | | | | | | | | | The "cycle" command _declaration_ enables repeatability by default, however, the command handler applies additional logic to augment it, based on the property which is being cycled - using some guesswork. Specifically, properties with discrete values are not repeatable (like sub or osd-level), while continuous properties are repeatable (like volume). Previously, the "repeatable" prefix could not override this additional logic. This commit changes the behavior so that the logic affects only the default repeatability (still based on the property like before), however, the "repeatable" prefix is now allowed to override it.
* osd_libass: --osd-back-color: apply to the progress barAvi Halachmi (:avih)2021-08-191-0/+16
| | | | | | | This is an artificial background box with the original colors, rendered as a plain rectangle instead of libass's opaque-box. Fixes #9134 (together with the previous commit)
* osd_libass: disable --osd-back-color for the progress barAvi Halachmi (:avih)2021-08-191-0/+8
| | | | | | | This breaks the rendering in various ways, so first workaround is to simply disable the opaque box for the bar. Next commit will add an artificial background box.