summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wayland: support the display-hidpi-scale propertyDudemanguy2021-04-121-0/+8
| | | | | | | | | | | | | | So apparently this property had existed since 2019. Internally, it's used as a part of the console.lua script for scaling. Yours truly somehow didn't bat an eye at the fact that the text in the console was super small (made worse by the fact that xwayland does scale) and just ignored it for all this time. Oh well. To report dpi changes to mpv's core, we need to use VO_EVENT_DPI in a couple of places. One place is, of course, the surface listener if the scale value reported by the wayland server changes. The other place is in the very first reconfig since mpv's core will not find the correct scale value until we actually get a wl_output from the wayland server.
* demux: undeprecate --cache-secssfan52021-04-083-8/+2
| | | | | It serves a purpose and a rework of the cache won't be coming anytime soon. This partially reverts commit 8427292eb7c4074e1205c3d73c53c9e82569325f.
* audio/aframe: reuse data buffer if less than 8 channelssfan52021-04-081-6/+12
| | | | | | | | This fixes audio encoding crashing under ASan. When extended_data != data, FFmpeg copies more pointers from extended_data (= the number of channels) than there really are for non-planar formats (= exactly 1), but that's not our fault. Regardless, this commit makes it work in all common cases.
* stream: turn stream_info.open2's args argument constsfan52021-04-085-5/+5
| | | | So nobody comes up with the "smart" idea to modify those again.
* stream_slice: fix use-after-free if inner stream fails to opensfan52021-04-081-2/+3
| | | | | | The args struct is reused to attempt opening an URL with different stream layers, overwriting args->url not only breaks this but also causes the freed buffer to be used again.
* player/scripting: fix use-after-free when loading script folderssfan52021-04-081-2/+3
|
* stream_mf: set correct stream originsfan52021-04-081-0/+1
| | | | | mf:// reads files from the local filesystem and should be subject to the usual security checks mpv has for such protocols.
* demux_mf: improve format string processingAvi Halachmi (:avih)2021-04-051-2/+37
| | | | | | | | | | | | | | | | | | | | | Before this commit, the user could specify a printf format string which wasn't verified, and could result in: - Undefined behavior due to missing or non-matching arguments. - Buffer overflow due to untested result length. The offending code was added at commit 103a9609 (2002, mplayer svn): git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4566 b3059339-0415-0410-9bf9-f77b7e298cf2 It moved around but was not modified meaningfully until now. Now we reject all conversion specifiers at the format except %% and a simple subset of the valid specifiers. Also, we now use snprintf to avoid buffer overflow. The format string is provided by the user as part of mf:// URI. Report and initial patch by Stefan Schiller. Patch reviewed by @jeeb, @sfan5, Stefan Schiller.
* manpage: fix a typo in the --aid option noteun.def2021-04-051-1/+1
|
* vo_gpu: adjust interpolation_threshold's defaultLaserEyess2021-03-282-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mpv attempts to play a video that is, on average, 60 FPS on a display that is not exactly 60.00 Hz, two options try to fight each other: `video-sync-max-video-change` and `interpolation-threshold`. Normally, container FPS in something such as an .mp4 or a .mkv is precise enough such that the video can be retimed exactly to the display Hz and interpolation is not activated. In the case of something like certain live streaming videos or other scenario where container FPS is not known, the default option of 0.0001 for `interpolation-threshold` is extremely low, and while `video-sync-max-video-change` retimes the video to what it approximately knows as the "real" FPS, this may or may not be outside of `interpolation-threshold`'s logic at any given time, which causes interpolation to be frequently flipped on and off giving an appearance of stuttering or repeated frames that is oftern quite jarring and makes a video unwatchable. This commit changes the default of `interpolation-threshold` to 0.01, which is the same value as `video-sync-max-video-change`, and guarantees that if the user accepts a video being retimed to match the display, they do not additionally have to worry about a much more precise interpolation threshold randomly flipping on or off. No internal logic is changed so setting `interpolation-threshold` to -1 will still disable this logic entirely and always enable interpolation. The documentation has been updated to reflect this change and give context to the user for which scenarios they might want to disable `interpolation-threshold` logic or change it to a smaller value.
* options: Add validation macro for int typePhilip Langdale2021-03-281-0/+8
| | | | As an illustrative example.
* demux: Move demuxer help to new standard mechanismPhilip Langdale2021-03-284-13/+9
| | | | | Previously, demux help was handled as a special case in main.c and this is no longer necessary.
* options: Make validation and help possible for all option typesPhilip Langdale2021-03-2814-106/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, validation is only possible for string type options. But there's no particular reason why it needs to be restricted in this way, and there are potential uses, to allow other options to be validated without forcing the option to have to reimplement parsing from scratch. The first part, simply making the validation function an explicit field instead of overloading priv is simple enough. But if we only do that, then the validation function still needs to deal with the raw pre-parsed string. Instead, we want to allow the value to be parsed before it is validated. That in turn leads to us having validator functions that should be type aware. Unfortunately, that means we need to keep the explicit macro like OPT_STRING_VALIDATE() as a way to enforce the correct typing of the function. Otherwise, we'd have to have the validator take a void * and hope the implementation can cast it correctly. For help, we don't have this problem, as help doesn't look at the value. Then, we turn validators that are really help generators into explicit help functions and where a validator is help + validation, we split them into two parts. I have, however, left functions that need to query information for both help and validation as single functions to avoid code duplication. In this change, I have not added an other OPT_FOO_VALIDATE() macros as they are not needed, but I will add some in a separate change to illustrate the pattern.
* vo_gpu: placebo: keep track of texture sample modeNiklas Haas2021-03-211-0/+4
| | | | | | This fixes an issue where dithering was effectively broken on libplacebo versions >= 103 because the dither texture was being sampled with edge-clamped rather than repeating semantics.
* stats.lua: include a filter's @label when displaying filters on page 1Chris Varenhorst2021-03-151-0/+4
|
* ao_oss: add this audio output againrim2021-03-155-1/+424
| | | | | | | | | | | Changes: - code refactored; - mixer options removed; - new mpv sound API used; - add sound devices detect (mpv --audio-device=help will show all available devices); - only OSSv4 supported now; Tested on FreeBSD 12.2 amd64.
* audio: prevent uninit_audio_out during encodingTom Wilson2021-03-151-1/+2
| | | | | | | | | | | There was a simple oversight that meant audio outputs were uninitialized during an encoding, which is not allowed, the encoding would stop with numerous errors. I added a single line to prevent the call of uninit_audio_out in reinit_audio_chain if the encoder was active and this appears to have fixed the problem without breaking anything else. Fixes #8568
* stream_lavf: add support for Gopher over TLS.parazyd2021-03-151-1/+1
| | | | | | | Gopher over TLS (gophers) is a community-adopted protocol and has recently been merged in: - curl (a1f06f32b8603427535fc21183a84ce92a9b96f7) - ffmpeg (51367267c8a9f1a840f5e810f8c788e6e03712a5)
* ao/pulse: signal the mainloop when ops are doneThomas Weißschuh2021-03-111-2/+5
| | | | | | | | Without the explicit signal the call to pa_threaded_mainloop_wait() will not return as soon as possible. Fixes 4f07607888541e6eb40fc5c3a1edfeb84aacb0f7 See #8633
* player/command: add albumart argument to video-addTom Wilson2021-03-093-4/+13
| | | | | | Enables marking of specific video sources as album art. Co-authored-by: Jan Ekström <jeebjp@gmail.com>
* player/{core,loadfile}: make cover art loading more explicitJan Ekström2021-03-093-10/+16
| | | | | | | | | | | | | Now loading cover art through mp_add_external_file requires an additional argument to be set to true. This way not all video-add commands end up being marked as cover art when they move through mp_add_external_file, as originally changed in 55d7f9ded197d82d172b7baf74b1a07640361ae8 . Additionally, this lets us clean up some logic that would otherwise be duplicated between open_external_files and autoload_external_files, if the logic had been kept split from mp_add_external_file. Fixes #8358
* ao/pulse: wait for command completion when setting volume or muteThomas Weißschuh2021-03-091-13/+8
| | | | | | | | | | | | | | | | This makes the behavior of all control messages consistent, fixing an inconsistency that has been with us since 4d8266c739915184d3787d7ab727ac03378b341b - which is the initial rework of the polyaudio AO into the pulseaudio AO. Muting the stream also directly triggers an update to the OSD. When not waiting for the command completion this read of the mute property may read the old state. A stale read. Note that this somehow was not triggered on native Pulseaudio, but it is an issue on Pipewire. See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/868
* ytdl_hook: fix crash on missing track bitraternhmjoj2021-03-081-1/+1
| | | | | | | | Some tracks happen to lack bitrate information (ie. no tbr value). In that case, just ignore the track while computing the max bitrate. For an example, this is a stream in which all audio tracks have no bitrate: https://www.raiplay.it/dirette/rai1
* umpv: Use generator expression for filesjimman20032021-03-031-1/+1
| | | Instead of list. potential memory savings.
* wayland: no mouse dragging in fullscreen/maximizedDudemanguy2021-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | The wayland code takes mouse dragging into account in order to trigger a client-side request for a window move or window resize. According to the xdg-shell spec*, "[t]he server may ignore move[/resize] requests depending on the state of the surface (e.g. fullscreen or maximized)". Since it is not actually a hard requirement, that means the compositor could actually respond to a clientside move/resize request even if the mpv window was fullscreen. For example, it was pointed out that in sway, if mpv is a floating window, you could drag it around off screen even though the window is fullscreen. This kind of behavior does not really have any practical use. A user can should pan a video if he/she wishes to move its orientation while fullscreen (or maximized for that manner). Naturally, a maximized or fullscreened window should never be manually resized (every compositor likely ignores this anyway). The fix is to simply just not trigger the smecial mouse dragging case if the wayland surface is fullscreened or maximized. *:https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/stable/xdg-shell/xdg-shell.xml
* manpage: mention rotate limitations with hwdecGuido Cella2021-03-021-0/+4
|
* vd_lavc: wrap use of deprecated AVCodecContext.thread_safe_callbacks in #ifsfan52021-03-021-0/+2
| | | | For compatibility once FFmpeg removes it entirely.
* manpage: video-rotate supports arbitrary stepsGuido Cella2021-03-021-5/+4
| | | | | The 90° step limitation must be a leftover from old behavior since any value between 0 and 359 works now.
* mac: fix traditional fullscreen on macOS 11der richter2021-02-272-4/+20
| | | | | | | | | | | the fullscreen style mask is not supported on macOS 11 anymore outside of the native fullscreen animation. this can lead to a none working fs or in the worst case a crash. to fix this we will simulate a fullscreen window with a borderless window with the size of the whole screen, though only on macOS 11. Fixes #8490
* mac: remove an unused variableder richter2021-02-271-1/+0
|
* vo_gpu: libplacebo: require v2.72.0Niklas Haas2021-02-232-52/+2
| | | | | | | | | | | | It's about a year old, and packaged pretty much everywhere that bothers to package libplacebo at all. Older versions are only a thing on LTS, which will probably also use older mpv so it works out. Starting with v2.72.0, libplacebo validates all of its parameters internally and turns them into function failures. Doing it twice is awfully redundant, so we can drop the parameter validation. Also allows us to drop some preprocessor macros.
* appveyor: Use MSYS2's spirv-cross package instead of building itBiswapriyo Nath2021-02-231-9/+1
|
* appveyor: use latest build image for fixed MSYS2 installationBiswapriyo Nath2021-02-231-12/+4
| | | | | As MSYS2 installer issues are fixed, remove the workaround from previous commits b8104a013d958e3f177891b22949fc2e66eab955 and ea91162802432aabc8a86216d56223f690e49a67
* msg: fix really-quiet option to only affect terminal outputder richter2021-02-231-2/+2
| | | | | | | | | | | | if log-file and really-quiet options were used together it could lead to a completely empty log-file. this is unexpected because we need the log-file option to work in all cases and produces at least a log of verbosity -v -v. this is a regression of commit a600d152d21ef398eb72b008ee3fe266696eb638 move the really quiet check back up, so it's set before the evaluation of the actual log level, where check for log file, terminal, etc take place.
* mac: add ability to toggle visibility on all workspaces from menubarEvgeny Zinoviev2021-02-211-0/+7
|
* command: add label for on-all-workspaces commandEvgeny Zinoviev2021-02-211-0/+1
|
* mac: support --on-all-workspaces optionEvgeny Zinoviev2021-02-213-1/+14
|
* vo_gpu: don't abort() if plane tex creation failsNiklas Haas2021-02-161-3/+4
| | | | | | | In this case, we just treat all uploads as automatically failing. That error path already exists and is already handled correctly. Fixes #8566
* filters/auto_filters: switch from scaletempo to scaletempo2Jan Ekström2021-02-153-5/+5
| | | | | | | Part 1 of "look how well it performs, then start cleaning up the old one." Closes #8376
* af_scaletempo2: fix crash for speed >= 16Dorian Rudolph2021-02-151-9/+13
| | | | | | | The input buffer size was fixed, but the required size depends on the speed. Now the buffer will be resized dynamically. Fixes #8081
* travis: fix macOS VMs with older homebrew versionsder richter2021-02-131-2/+10
| | | | | | apparently travis changed the homebrew setup and that broke the build. reasons was a different homebrew version that doesn't support the new brew cli.
* mac: only update touch bar items when necessaryder richter2021-02-132-87/+150
| | | | | | | | | | | | | | | | the slider on the touch bar was always updated when any of the related properties changed their value. this is partially dependent on the refresh rate of the video, in the case of time-pos. too many updates to touch bar impact the render performance. to prevent this we only update the slider when necessary, when the touch bar or the touch bar item is visible. the touch bar items only need a granularity of seconds without any decimals, but the time-pos property provides a granularity with decimals. we floor those values and only update the touch bar items when we have at least a 1 second difference. we also check for the visibility of the touch bar and its items. Fixes #8477
* mac: use custom touch bar item and slider instead of a touch bar sliderder richter2021-02-131-9/+9
| | | | | | | | | | | | | the NSSliderTouchBarItem seem to be broken in a way it can't be fixed. it has constraints set by default that can't be removed and lead to warnings and render performance regressions. instead of using the preconfigured NSSliderTouchBarItem we use a custom touch bar item (NSCustomTouchBarItem) with a slider, which essential are the same. this way we can configure our constraints ourselves, which aren't needed in the first place. Fixes: #7047
* vo_gpu: vaapi: export plane pitch properlyNiklas Haas2021-02-121-0/+4
|
* DOCS: fix cplugins information in libmpv.rst.Érico Rolim2021-02-121-2/+2
|
* demuxer/demux_mf: add support for more image codecsPaul B Mahol2021-02-061-0/+2
|
* man: update deband-threshold defaultMia Herkt2021-02-051-1/+1
|
* vo_gpu: lower default deband thresholdMia Herkt2021-02-051-1/+1
| | | | | The previous default was found to be too aggressive for most video. Change to a lower value to prevent destroying too much detail.
* vo_wlshm: support big endian systemsEmmanuel Gil Peyrot2021-02-041-1/+2
| | | | The video was otherwise blue, and that’s not how it should be. :)
* README: update libass dependency harfbuzz as non-optionalder richter2021-01-241-3/+3
| | | | | | since libass 0.15 harfbuzz is no longer optional. Fixes #8412
* manpage: fix PDF buildgaroto2021-01-231-4/+6
| | | | | Not clear what exactly makes it fail with this change, but making the note paragraph added in d5ab5482a9 a note structure seems to fix it.
* docs: Fix an old style parameter referenceChris Varenhorst2021-01-201-1/+1
| | | | `--vf format:stereo-in=help` no longer works. It now must be `--vf=format:stereo-in=help`
* umpv: remove unused importsJim Manos2021-01-191-2/+0
| | | | | | | * fcntl usage was replaced by socket usage in 518bd4c306d50e6772c39c5d7395b9d10b9386da * stat usage was removed in 51a3f13705f8b65b3bfcef5b991903d225759014 as the socket was created under the user's HOME.
* stream_lavf: support rtspsMia Herkt2021-01-191-4/+4
| | | | Fixes #8480
* player: make resetting of track selection to "auto" worksfan52021-01-161-9/+21
|
* mac: fix dangling pointersder richter2021-01-132-31/+32
| | | | | | initialising UnsafeMutableRawPointer the way we did won't free those pointers and we get dangling pointers. explicitly define a scope those pointers are alive and auto freed.
* mac: drop build support for swift versions earlier than version 4.1der richter2021-01-134-52/+21
| | | | | | | | | | | | this drops support for swift <4.1 and with this support for xcode <=9.2. this was the last setup that is officially working on macOS 10.12. our old legacy build macOS 10.12 + xcode 9.2 is replaced by macOS 10.13 + xcode 9.4.1 with swift 4.1. the macOS 10.13 + xcode 10.1 VM is replaced by the latest macOS 10.14 + xcode 11.3.1 VM. this is the oldest version officially supported by Apple. this is in preparations for the following commit.
* mac: fix usage of temporary pointersder richter2021-01-132-29/+57
| | | | | | | | | | | the pointer used to initialise the respective structs is only guaranteed to be alive within this constructor. the struct itself is used later and the data it points to, is not guaranteed to be the same. to fix this we define a scope that pointer is definitely valid and use it within this scope. a helper function was added to get the pointers for several data at once. otherwise we would need to nest withUnsafeMutableBytes several times, which would make it hard to read.
* manpage: document off-by-one loop-file behaviorLeo Izen2021-01-071-0/+5
| | | | | loop-file counts the number of zero-seeks, not playthroughs, which makes its counter off by one compared to loop-playlist.
* manpage: rename OS X references to macOSLeo Izen2021-01-034-36/+36
| | | | | | | | Apple has decided that Mac OS X is now named macOS for the time being. For consistency, it makes sense to use the same name for the operating system in all places where it occurs. This commit renames OS X to macOS in the documentation in places where it was otherwise still using the old name.
* vo_gpu: don't segfault if 3DLUT texture fails uploadingNiklas Haas2021-01-011-0/+5
| | | | This failure path was never properly checked.
* input.conf syntax: support custom quotes !XstringX!Avi Halachmi (:avih)2020-12-312-8/+31
| | | | | | | | | | Where X is any ASCII char chosen by the user. An argument is only interpreted as custom-quoted if it starts with '!' and the line doesn't end right after it. Custom quotes don't interpret backslash-escape. This change only affects command arguments which mpv parses (not array commands), and not tokens before the arguments (where applicable - key name, input section, command prefixes, command name).
* input.rst: fix typo commands -> argumentsAvi Halachmi (:avih)2020-12-311-1/+1
|
* csputils: add mappings for DCI-P3 (ST.431-2) and P3-D65 (ST.432-1)Jan Ekström2020-12-301-0/+4
|
* vd_lavc: add VP8 to the default allowed hwdec co