summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release 0.31.0v0.31.0release/0.31sfan52019-12-283-81/+56
|
* DOCS/tech-overview.txt: some more blablawm42019-12-281-27/+67
| | | | | This file is only complete once it contains the entire mpv source code in English form.
* audio: react to --ao and --audio-buffer runtime changeswm42019-12-271-3/+3
| | | | | | Before this commit, runtime changes were only applied if something else caused audio to be reinitialized. Now setting them reinitializes audio explicitly.
* m_option: fix runtime changing of --audio-channelswm42019-12-271-3/+14
| | | | | | | | This option type, used by --audio-channels, had a completely broken m_option_type.equal implementation, and thus reacted incorrectly to runtime option changes. Broken since commit b16cea750f527088be7977.
* DOCS/tech-overview.txt: add lots of irrelevant blablawm42019-12-271-0/+373
| | | | | | Thought it might be useful to document some of these things, instead of explaining them over and over again. But I can guarantee that nobody will ever read all this. (Independent of its quality and completeness.)
* cocoa-cb: force redraw when screen or size changesder richter2019-12-241-0/+2
| | | | | | | | | in certain circumstances the video was not redrawn even when the size or the backing scale factor changed. this could lead to a lower resolution output than intended. now it redraws the video when screen properties or the window size changes.
* cocoa-cb: implement hidpi scale reportingder richter2019-12-242-0/+7
|
* console: add a basic help commandwm42019-12-241-1/+50
| | | | | | | | | | | | | | | It's not really great. But I think it's good enough to save someone who's lost. Most importantly, it should become obvious _what_ the console expects (input commands), and how to exit it. Would be nice if we could show some documentation, or give a link to documentation, but that's out of scope and/or not easy. I considered implementing the "help" command as builtin command in command.c. On the other hand, this could not show console.lua specific help, so I implemented it in console.lua. The ad-hoc command parsing (that sort-of mirrors mpv input command syntax) for the "help" command is probably the worst part of this.
* console: do not strip leading spaceswm42019-12-241-0/+3
| | | | As suggested by TheAMM and avih.
* command: extend command-list outputwm42019-12-241-0/+14
| | | | Add some very basic information about arguments.
* manpage: fix example in --hwdec sectionwm42019-12-241-1/+3
|
* stats: do not use "tick" eventwm42019-12-241-2/+6
| | | | | | | | It's deprecated. The new solution works almost exactly the same way (since the still existing internal tick event triggers vsync-jitter change command), though as far as API usage goes, it's somewhat questionable. (The comment is meant to discourage anyone trying to copy the idea for external scripts.)
* build: force bootstrap.py to use python3Niklas Haas2019-12-241-1/+1
| | | | The script fails running successfully with python2.
* osc: redraw on visibility option runtime changeswm42019-12-241-0/+1
| | | | | | This affects behavior when using the "del" default key binding. Sometimes, setting visibility to always did not draw it correctly. This probably fixes it.
* vd_lavc: remove hwdec-by-default special case for RPIwm42019-12-242-1/+4
|
* vd_lavc: more hwdec autoselect nonsensewm42019-12-242-21/+85
| | | | | | | | | | | | | Add an "auto-safe" mode, mostly triggered by Ubuntu's nonsense to force hwdec=vaapi in the global config file in their mpv package. But to be honest it's probably something more people want. This is implemented as explicit whitelist. On Windows, HEVC/Intel is sometimes broken, but it's still whitelisted, and in theory we'd need a detailed whitelist of device names etc. (like for example browsers tend to do). On OSX, videotoolbox is a pretty bad choice, but unfortunately the only one, so it's whitelisted too. There may be a larger number of hwdec wrappers that work anyway, and I'm for example ignoring Android.
* build: fix build with disabled swift and Media Playerder richter2019-12-232-1/+7
| | | | | | | | | | | | | | when swift is disabled some headers are not included. one of them is the options/options.h header that is needed for the vo_sub_opts struct. we include it to fix the build without swift. the second problem is the build time check for the macOS 10.12.2 features or more specific the Media Player support. since it is a swift feature we can not use it when swift is disabled. add a separate Media Player check that also depends on swift and use that new preprocessor variable as a build time check instead. Fixes #7282
* js: support mp.create_osd_overlay (match 07287262)Avi Halachmi (:avih)2019-12-233-23/+57
| | | | | The legacy mp.set_osd_ass(...) is still supported (but also still undocumented) as a wrapper for the new mp.create_osd_overlay(...).
* js: batch key bindings updates (match 96932fe7)Avi Halachmi (:avih)2019-12-231-3/+12
| | | | | | | Implemented using one-time idle observer (i.e. setTimeout), to avoid additional function call(back) every time the event loop enters idle. The lua mp.flush_key_bindings() is also available, also undocumented.
* osc: add option to disable santa hatNicolas F2019-12-232-2/+8
| | | | | | | | | | A minority of users have expressed a dislike of hats, calling them "cancer [that] don't belong in software" describing the people who add them as "shitty circlejerks" and "chucklefuck." While I personally disagree with those opinions, it's probably easier to let them have it their way. For that reason this adds the option `greenandgrumpy` to the osc, which allows users to disable the hat.
* lua: fix guard against division by 0wm42019-12-231-1/+1
| | | | | This was incorrectly converted from the original C code. Change it to what the original code used.
* lua: fix passing non-integers to mp.set_osd_ass()wm42019-12-231-0/+2
| | | | | | | | | | | | | | libass uses integers for PlayResX/Y, so the osd-overlay command also does. Lua (pre-5.3) does not have an integer type, but the command interface makes a difference anyway. If you pass a Lua number with a fractional part to an integer parameter (using mp.command_native()), it will result in an error and complain about incompatible types. I think that's fine, but since this behavior extends to mp.set_osd_ass(), this is a compatibility problem. Fix this by explicitly coercing the resolution parameters to integer numbers.
* osc: set an arbitrary high Z-orderwm42019-12-231-0/+1
| | | | | | | | The main reason for this is just to make show the OSC always above console.lua, instead of a random order. (And this is also the only reason osc.lua was changed to the new API. The old API could have been extended, but lets not.)
* osc: use new overlay APIwm42019-12-231-5/+18
| | | | | | | | | This tries to avoid the update() call if nothing changed. This brings it more into line with the old code (the osd-overlay command simply does not skip the update if nothing changed). I don't know whether this matters; most likely not. Normally, code should try to avoid redundant updates on its own, so it's not the job of the command. However, for the OSC we simply want to reduce the differences.
* client API, lua: add new API for setting OSD overlayswm42019-12-2311-68/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | Lua scripting has an undocumented mp.set_osd_ass() function, which is used by osc.lua and console.lua. Apparently, 3rd party scripts also use this. It's probably time to make this a public API. The Lua implementation just bypassed the libmpv API. To make it usable by any type of client, turn it into a command, "osd-overlay". There's already a "overlay-add". Ignore it (although the manpage admits guiltiness). I don't really want to deal with that old command. Its main problem is that it uses global IDs, while I'd like to avoid that scripts mess with each others overlays (whether that is accidentally or intentionally). Maybe "overlay-add" can eventually be merged into "osd-overlay", but I'm too lazy to do that now. Scripting now uses the commands. There is a helper to manage OSD overlays. The helper is very "thin"; I only want to force script authors to use the ID allocation, which may help with putting multiple scripts into a single .lua file without causing conflicts (basically, avoiding singletons within a script's environment). The old set_osd_ass() is emulated with the new API. The JS scripting wrapper also provides a set_osd_ass() function, which calls internal mpv API. Comment that part (to keep it compiling), but I'm leaving it to @avih to finish the change.
* lua: batch-update key bindingswm42019-12-231-3/+11
| | | | | | | | | | | | | | Lua scripting implements key bindings by defining an input section with all the bindings in it. Every add_key_binding() call ran a mpv command to update this section. This caused a lot of spam at debug log levels. Reduce the spam and more it efficient by batching updates into a single mpv command when the script becomes inactive. This is pretty simple, because there's already the concept of idle handlers. This requires that the script actually goes to sleep, which might not happen in various extremely bogus corner cases, such as polling the mpv message queue with active waiting. Just don't do that.
* manpage: document that --vo=xv breaks "boxvideo"wm42019-12-231-0/+3
| | | | (OK, maybe a bit redundant, since vo=xv breaks a lot of stuff.)
* demux: stop setting dummy stream on demux_close_stream()wm42019-12-232-7/+9
| | | | | | | | | | | | | | Demuxers can call demux_close_stream() to close the underlying stream if it's not needed anymore. (Useful to release "heavy" resources like FDs and sockets. Plus merely keeping a file open can have visible side effects such as inability to unmount a filesystem or, on Windows, to do anything with the file.) Until now, this set demuxer->stream to a dummy stream, because most code used to assume that the stream field is non-NULL. But this requirement disappeared (in some cases, the stream field is already NULL), so stop doing that. demux_lavf.c, one of the demuxers which calls this function, still had some of this, though.
* stream_concat, stream_memory: more stream_origin stuffwm42019-12-232-0/+19
| | | | | | Make concat streams use the "worst" origin of its parts, which may or may not be what makes sense. stream_memory has no natural way to do this, so just add a vague comment.
* bstr: remove unused bstr_splitlines() functionwm42019-12-232-23/+0
|
* demux_mf: use stream API to open list fileswm42019-12-231-15/+28
| | | | | | | | | | mf:// has an obscure feature that lets you pass a list of filenames separated by newlines. Who knows whether anyone is using that. It opened these listfiles with fopen(), so the recent stream origin bullshit doesn't operate on it. Fix this by using the mpv internal stream API instead. Unfortunately there is no fgets(), so write an ad-hoc one. (An implementation of line reading via "stream" is still in demux_playlist, but it's better to keep it quarantined there.)
* osc: display Santa hat for idle logo in DecemberTheAMM2019-12-231-18/+43
| | | | | | | | | | During the 12th month (checked during script initialization), draw a Santa hat on top of the idle message's logo. Slightly refactors and optimizes the drawing process as well: reorder original logo layers and remove redundant holes in them, use a shared line prefix to clear the style and set start position. Signed-off-by: wm4 <wm4@nowhere>
* client API: deprecate tick eventwm42019-12-223-3/+7
| | | | | This is conceptually outdated and should not exist. This affects Lua scripting and JSON IPC too.
* js: read_options: on_update: don't re-read the config fileAvi Halachmi (:avih)2019-12-222-4/+4
| | | | | | | | | | | | | Now that 00af718a made the lua read_options behavior much more similar to the js behavior, the main difference was that lua does not re-read the config file at on_update (but it does re-apply its stored content) while js did re-read it. Now the js on_update also does not re-read the config file and instead applies its stored original content. This is slightly hacky by adding an undocumented optional 4th argument to read_options which allows overriding the config file content.
* console: reduce border sizewm42019-12-221-1/+1
| | | | | This looks better if the ASS canvas size is used to scale according to HiDPI factor (instead of font size).
* osc: use video margins only if OSC is visiblewm42019-12-221-6/+5
| | | | | Looks awkward otherwise. This means that even if boxvideo is enabled, nothing gets "boxed" if the OSC is set to auto-hide.
* osc: cleanup boxvideo margin handlingwm42019-12-221-20/+23
| | | | | | | | | | Make sure it gets properly reinitialized when needed. This is especially useful now that the OSC reacts to runtime option changes, which can change the layout too. This may call set_property_number() on the margin properties more often now, but since redundant option changes are ignored now, this shouldn't have any too bad effects.
* osc: full reinit on runtime option changeswm42019-12-221-3/+2
| | | | | | | | | Fuck it, just let's just reinit everything. On a side note, the changelist parameter provided by read_options() (here "list") is now unused. But it's not hard to provide and might be useful for other stuff. So don't remove it from the generic read_options() code.
* lua: change runtime option change behaviorwm42019-12-222-24/+33
| | | | | | | | | | | | As described in the manpage changes. This makes more sense than the previous approach, where options could "unexpectedly" stick. Although this is still a somewhat arbitrary policy (ask many people and you'd get a number of different expectations on what should happen), I think that it reflects what mpv's builtin stuff does. All the copying is annoying, but let's just hope nobody is stupid enough to change these properties per video frame or something equally ridiculous.
* demux: remove debug abort()wm42019-12-221-1/+1
| | | | | | WHAT THE FUCK Fixes: #7279
* vo_gpu: vulkan: set allow_suboptimal when possibleNiklas Haas2019-12-221-0/+5
| | | | | This was added in libplacebo v1.29.0 and allows making resizes slightly smoother for clients that already handle resize events (such as mpv).
* video/out/x11: add fs-screen fallbackNicolas F2019-12-223-2/+7
| | | | | | | | | | | | | Apparently there are two different options for controlling which screen an mpv window goes onto: --fs-screen and --screen. The former explicitly only controls which screen a fullscreened window goes onto, but does not appear to actually care about this option at runtime for X11, so pressing f will always fullscreen to the screen mpv is currently on. This means the option is of questionable usefulness for starters. Making it worse, if you use --screen=1 --fs, mpv will actually fullscreen on screen 0, because --fs-screen isn't set. Instead of doing that, fall back to whatever --screen is set to.
* command: fix confusing displayed aspect-ratioAbdullah Alansari2019-12-221-0/+33
| | | | | For example, when a user switches the aspect-ratio display `16:9` instead of `1.778` and `Original` instead of `-1.000`.
* js: read_options: support on_update (match 478a321d)Avi Halachmi (:avih)2019-12-212-3/+18
| | | | | | | | | | | | | This is a bit different than the lua code: on script-opts change it simply re-applies the conf-file and script-opts to the options object, and if this results in any changed value at options then on_update is called with the changelist as argument. This allows a value to revert back to the conf-file value if the matching script-opts key had a different value and then got deleted. It also guarantees to call back whenever the options object is modified, which the lua code doesn't do (e.g. if the caller changed a value and the observer changed it back - it won't detect a change).
* osc: cosmetics: remove some excessive whitespacewm42019-12-201-7/+0
|
* osc: react to script-opts runtime changeswm42019-12-201-1/+8
| | | | | | | | | | With special attention to changing osc-visibility. Untested, although osc-visibility works (it's pretty much equivalent to the key binding, so there is not much interesting going on). Somewhat inspired by code posted by github user CogentRedTester. Fixes: #4513
* lua: add a helper for runtime script option changeswm42019-12-202-17/+71
| | | | | A script can use this to easily get runtime updates. (Even if script-opts is sort of clunky.)
* osc: rearrange hidetimeout/visibiltiy handlingwm42019-12-201-19/+19
| | | | | | | | | | The way how this modifies and backups/restores user option values is a bit of a problem for runtime option changing. Clean this up a little. Now cycling the visibility updates the user option value, but always to "valid" values (unlike hidetimeout used to be used). If the user option value is changed externally (enabled by a later commit), it'll be cleanly overwritten.
* osc: move windowcontrols option code to the right placewm42019-12-201-15/+14
| | | | | | There doesn't seem to be a reason why it was where it was. It should be in validate_user_opts(), which will be important for runtime changing too.
* manpage: add osc and console default keys to keyboard control sectionwm42019-12-201-0/+6
| | | | | | Although they were not undocumented, they were hidden away in the respective manpage sections. It's a good idea to add them to the main keyboard bindings overview too. stats.lua also did this.
* console: use hidpi scale reportingwm42019-12-202-3/+11
| | | | | | | | I decided to factor this into the user's scale option (instead of somehow using it as default if the user has not specified it), because it makes the option handling simpler, and won't break things like per-screen DPI if the user only wants to scale the console font by a factor.
* x11: implement hidpi scale reportingwm42019-12-201-0/+3
| | | | | | | (X11 does not support different per-screen DPI (or only via hacks), so this is pretty simple. If other backends are going to implement this, then they should send VO_EVENT_WIN_STATE if the DPI for the mpv window changes by moving it to another screen or such.)
* command: add property returning hidpi scalewm42019-12-203-0/+19
|
* demux: add an option to control tag charsetwm42019-12-203-1/+96
| | | | | | Fucking gross that you need this in almost-2020. Fixes: #7255
* edl: accept arbitrary pathswm42019-12-202-20/+0
| | | | | | | | | | Until now, .edl files accepted only "simple" filenames, i.e. no relative or absolute paths, no URLs. Now that the origin bullshit is a bit cleaned up and enforced in the EDL code, there's absolutely no reason to keep this. The new code behaves somewhat similar to playlists. (Although playlists are special because they're not truly recursively opened.)
* stream, demux: redo origin policy thingwm42019-12-2034-70/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mpv has a very weak and very annoying policy that determines whether a playlist should be used or not. For example, if you play a remote playlist, you usually don't want it to be able to read local filesystem entries. (Although for a media player the impact is small I guess.) It's weak and annoying as in that it does not prevent certain cases which could be interpreted as bad in some cases, such as allowing playlists on the local filesystem to reference remote URLs. It probably barely makes sense, but we just want to exclude some other "definitely not a good idea" things, all while playlists generally just work, so whatever. The policy is: - from the command line anything is played - local playlists can reference anything except "unsafe" streams ("unsafe" means special stream inputs like libavfilter graphs) - remote playlists can reference only remote URLs - things like "memory://" and archives are "transparent" to this This commit does... something. It replaces the weird stream flags with a slightly clearer "origin" value, which is now consequently passed down and used everywhere. It fixes some deviations from the described policy. I wanted to force archives to reference only content within them, but this would probably have been more complicated (or required different abstractions), and I'm too lazy to figure it out, so archives are now "transparent" (playlists within archives behave the same outside). There may be a lot of bugs in this. This is unfortunately a very noisy commit because: - every stream open call now needs to pass the origin - so does every demuxer open call (=> params param. gets mandatory) - most stream were changed to provide the "origin" value - the origin value needed to be passed along in a lot of places - I was too lazy to split the commit Fixes: #7274
* libarchive: prefix entry names in archive URLs with '/'wm42019-12-202-2/+4
| | | | | | | This has the advantage that playlists within the archive will work as expected, because demux_playlist will correctly join the archive base URL and entry name. Before this change, it could skip before the "|", resulting in a broken URL.
* osc: fix a commentwm42019-12-201-1/+1
|
* osc: fade out if paused and mouse position is outside of OSCwm42019-12-191-5/+18
| | | | | This broke with the recent changes since tick() is not called regularly anymore in paused mode. Add an explicit timer for this.
* osc: fix crash when toggling visibilitywm42019-12-191-1/+0
| | | | | The previous osc.lua related commit removed