summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '559a400ac36e75a8d73ba263fd7fa6736df1c2da' into ↵Anton Kindestam2018-12-051-0/+95
|\ | | | | | | | | | | wm4-commits--merge-edition This bumps libmpv version to 1.103
| * player: make various commands for managing external tracks abortablewm42018-05-241-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, they could be aborted only by ending playback, and calling mpv_abort_async_command didn't do anything. This requires furthering the mess how playback abort is done. The main reason why mp_cancel exists at all is to avoid that a "frozen" demuxer (blocked on network I/O or whatever) cannot freeze the core. The core should always get its way. Previously, there was a single mp_cancel handle, that could be signaled, and all demuxers would unfreeze. With external files, we might want to abort loading of a certain external file, which automatically means they need a separate mp_cancel. So give every demuxer its own mp_cancel, and "slave" it to whatever parent mp_cancel handles aborting. Since the mpv demuxer API conflates creating the demuxer and reading the file headers, mp_cancel strictly need to be created before the demuxer is created (or we couldn't abort loading). Although we give every demuxer its own mp_cancel (as "enforced" by cancel_and_free_demuxer), it's still rather messy to create/destroy it along with the demuxer.
| * client API: kill async commands on terminationwm42018-05-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | This affects async commands started by client API, commands with async capability run in a sync way by client API (think mpv_command_node() with "subprocess"), and detached async work. Since scripts might want to do some cleanup work (that might involve launching processes, don't ask), we don't unconditionally kill everything on exit, but apply an arbitrary timeout of 2 seconds until async commands are aborted.
| * lua: expose mpv_abort_async_command()wm42018-05-241-0/+9
| | | | | | | | Also somewhat cleans up mp.command_native_async() error handling.
| * command: add a subprocess commandwm42018-05-241-0/+5
| | | | | | | | | | | | | | This supports named arguments. It benefits from the infrastructure of async commands. The plan is to reimplement Lua's utils.subprocess() on top of it.
| * TOOLS: add a stupid test program for Lua async commandswm42018-05-241-0/+53
| |
* | TOOLS/autoload: Fixed broken "disabled" optionAndreas Wennerberg2018-06-231-0/+1
|/ | | | `--script-opts=autoload-disabled=yes` now properly stops the script from running.
* TOOLS/autoload: be more robust with slow directory listingsRicardo Constantino2018-03-101-11/+24
| | | | | | | | | | Overall, just shuffled code around and added a few debugging messages for future issues. The issue could be reproduced easily by quickly navigating through the playlist inside a network mount. Closes #5618
* TOOLS/autoload.lua: update extensionsCkat2017-12-031-1/+1
| | | | | * duplicated 'ogv' renamed to 'ogm' * 'ogg' and 'opus' added as common audio file extensions
* command: drop "audio-out-detected-device" propertywm42017-10-091-5/+0
| | | | | | Coreaudio stopped setting it a few releases ago (66a958bb4fa). There is not much of a user- or API-visible change, so remove it without deprecation.
* TOOLS/lua/autodeint: update to lavfi-bridgeRicardo Constantino2017-08-211-27/+38
| | | | | Also use lavfi setfield instead of removed field-dominance. Remove missing remainder of field-dominance in docs.
* TOOLS/autocrop.lua: fix cropdetect black limit for 10-bit videosRicardo Constantino2017-08-171-3/+4
| | | | | Also update to use newer lavfi-bridges for the relevant filters to shut up warnings about deprecated crop filter.
* TOOLS/autoload.lua: implement natural sortingRicardo Constantino2017-08-161-9/+32
|
* acompressor.lua: Convert to use mp.options and lavfi filter bridgeJan Janssen2017-08-071-79/+108
|
* TOOLS/lua/status-line: improve and updateRostislav Pehlivanov2017-08-041-6/+27
| | | | | | | Updates the line once per second rather than once per frame, saving quite a bit of CPU. Also completely stops the script while paused. That aside, fixes the swapped checks for video and audio-only files and adds bitrate printing.
* TOOLS/lua/autoload.lua: ignores all files starting with "."Yue Zhu2017-05-201-0/+3
|
* TOOLS/lua/autoload.lua: actually sort files case insensitiveRicardo Constantino2017-05-041-1/+2
| | | | | Regression since 8996f79edbf. Closes #4398
* TOOLS: add lua script for runtime acompressor ffmpeg filter controlJan Janssen2017-03-251-0/+126
|
* af_drc: removeJan Janssen2017-03-251-99/+0
| | | | | | | | | | | | | | | | Remove low quality drc filter. Anyone whishing to have dynamic range compression should use the much more powerful acompressor ffmpeg filter: mpv --af=lavfi=[acompressor] INPUT Or with parameters: mpv --af=lavfi=[acompressor=threshold=-25dB:ratio=3:makeup=8dB] INPUT Refer to https://ffmpeg.org/ffmpeg-filters.html#acompressor for a full list of supported parameters. Signed-off-by: wm4 <wm4@nowhere>
* TOOLS/autoload: allow disabling through script-optsRicardo Constantino2016-12-051-1/+8
| | | | | | | | | | | This allows leaving autoload in auto-loaded scripts and to be used in a special profile like "pseudo-gui" without being troublesome to disable the behavior in profiles that get applied after pseudo-gui. Ex: [someprofile] script-opts=autoload-disabled=yes
* TOOLS/lua/observe-all: explicitly observe all optionswm42016-09-231-1/+9
|
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-1/+1
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* TOOLS/lua/README: link to list of user scripts on wikiwm42016-03-181-1/+7
|
* TOOLS/lua/zones.lua: RemoveRicardo Constantino2016-03-081-74/+0
| | | | Check wiki/User-Scripts for more up-to-date version.
* TOOLS/lua/autoload.lua: remove the extension prior to sortAlexis Nootens2016-02-021-0/+5
| | | | | | When the directory contains files named such as xx-14.ext and xx-14.5.ext, remove the extension to sort the table to load the 14 before the 14.5.
* TOOLS/lua/ao-null-reload.lua: send ao-reload on audio-device-list changeKevin Mitchell2016-01-281-0/+20
| | | | | | | Only triggers if ao=null. This is required for ao=wasapi to recover from periods with no available devices. fixes #2738
* TOOLS/autoload: avoid throwing an error when playing e.g. youtubebitingsock2015-10-201-1/+6
| | | | Signed-off-by: wm4 <wm4@nowhere>
* TOOLS/lua/autoload: fix adding more files at end of auto-playlistRicardo Constantino2015-08-201-2/+5
| | | | | | | | | Fixes regression in dfd8a5f that made autoload not add more files at the end of the current playlist if playlist was made by the script. This still prevents loading the script if more than one (media or playlist) file was manually added.
* TOOLS/lua/autoload: add all files on startwm42015-08-201-2/+2
| | | | | | Or almost. I don't know or care. Fixes #2219 (maybe, I don't know or care).
* TOOLS/lua/autoload: don't run if playlist is loadedRicardo Constantino2015-08-101-0/+4
|
* TOOLS/lua: Add zones.luaRicardo Constantino2015-08-091-0/+74
| | | | | | | | | | | | | | | | | Lua script that enables handling of certain commands depending on where the mouse pointer is. Mostly useful for mouse-wheel handling via input.conf. Example: MOUSE_BTN3 script-message-to zones commands "*-left: add volume +5" "default: seek +10" MOUSE_BTN4 script-message-to zones commands "*-left: add volume -5" "default: seek -10" Will changes behavior of Mouse Wheel Up/Down to alter volume if mouse is in the left zone of the window, but re-adds the default to seek if wheel is used on other parts.
* TOOLS: remove youtube-starttime.luawm42015-07-291-34/+0
| | | | Obsolete due to native youtube-dl start time support.
* TOOLS: make autodeint detect telecine in parallelKevin Mitchell2015-07-161-45/+26
| | | | This avoids having to rewind the video for a second telecine detection pass.
* TOOLS/lua/status-bar: update use of a deprecated propertywm42015-05-251-1/+3
| | | | | Also mention that this code does not reflect the status line of current mpv.
* Remove trailing whitespacesMichael Vetter2015-05-152-3/+3
|
* TOOLS/autoload: load only files that make senseMarcin Kurczewski2015-04-211-0/+30
|
* TOOLS/autoload: add blank lines for readabilityMarcin Kurczewski2015-04-211-0/+7
|
* TOOLS: autoload.lua: sort files case insensitivewm42015-04-181-1/+3
| | | | | Suggested by a user. The suggested code which was added her comes from PIL.
* TOOLS: add a lua scripts for extracting and setting starttime with ytdlPatrick Hipp2015-03-231-0/+34
| | | | Signed-off-by: wm4 <wm4@nowhere>
* TOOLS: add a lua script for a -stay on top only during playback- modePatrick Hipp2015-03-231-0/+19
| | | | Signed-off-by: wm4 <wm4@nowhere>
* w32_common: support the "window-minimized" propertyJames Ross-Gowan2015-03-091-2/+0
|
* cocoa: support the "window-minimized" propertyJaime Marquínez Ferrándiz2015-03-081-1/+1
| | | | Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* ao_coreaudio: add support for hotplug notificationsStefano Pigozzi2015-02-141-0/+5
| | | | | | | | | | This commit adds notifications for hot plugging of devices. It also extends the old behaviour of the `audio-out-detected-device` property which is now backed by the hotplugging code. This allows clients to be notified when the actual audio output device changes. Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's device selection code is a bit fragile.
* audio: add device change notification for hotpluggingwm42015-02-122-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not very important for the command line player; but GUI applications will want to know about this. This only adds the internal API; support for specific audio outputs comes later. This reuses the ao struct as context for the hotplug event listener, similar to how the "old" device listing API did. This is probably a bit unclean and confusing. One argument got reusing it is that otherwise rewriting parts of ao_pulse would be required (because the PulseAudio API requires so damn much boilerplate). Another is that --ao-defaults is applied to the hotplug dummy ao struct, which automatically applies such defaults even to the hotplug context. Notification works through the property observation mechanism in the client API. The notification chain is a bit complicated: the AO notifies the player, which in turn notifies the clients, which in turn will actually retrieve the device list. (It still has the advantage that it's slightly cleaner, since the AO stuff doesn't need to know about client API issues.) The weird handling of atomic flags in ao.c is because we still don't require real atomics from the compiler. Otherwise we'd just use atomic bitwise operations.
* TOOLS/lua/observe-all: add a warningwm42015-01-031-0/+4
| | | | This is just natural, but it's also not that obvious.
* TOOLS/lua/autoload: fix behavior with network URLswm42015-01-031-0/+3
| | | | | readdir() fails if the directory is an URL, so just exit instead of letting the Lua script fail.
* options: deprecate 'lua' based options/dirs for 'script'Avi Halachmi (:avih)2014-12-153-5/+5
| | | | | | | | | | | | - --lua and --lua-opts change to --script and --script-opts - 'lua' default script dirs change to 'scripts' - DOCS updated - 'lua-settings' dir was _not_ modified The old lua-based names/dirs still work, but display a warning. Signed-off-by: wm4 <wm4@nowhere>
* lua: add a function that formats Lua values as stringswm42014-11-291-8/+2
| | | | | | | | Yep, Lua is so crappy that the stdlib doesn't provide anything like this. Repurposes the undocumented mp.format_table() function and moves it to mp.utils.
* TOOLS/lua: add script that pauses playback when minimizing the windowwm42014-11-291-0/+22
| | | | | | Uses functionality that was added a month ago for exactly this purpose. Fixes #1237.
* TOOLS/lua/autoload: fix operation outside of working dirwm42014-10-261-3/+7
| | | | Fixes #1222. (This commit is based on a patch posted there.)
* TOOLS/lua/autoload: don't shadow local variablewm42014-10-261-4/+4
| | | | "dir" is already used somewhere above. This was ok, but not nice.
* TOOLS/lua: update README.mdKevin Mitchell2014-10-211-9/+2
|
* TOOLS/lua: remove tabs from some lua scriptsKevin Mitchell2014-10-213-50/+50
|
* TOOLS/lua: add autodeint.luaKevin Mitchell2014-10-211-0/+164
| | | | | | | This isn't quite as robust as idet.sh as the default detection interval is only 4 seconds vs 35 for idet.sh. idet.sh can have such a large sample time since it turns off the vo and uses --untimed, which is currently not possible from lua.
* Move status-line.luawm42014-08-111-0/+69
| | | | | Looks like TOOLS/lua/ is now established as dumping ground for random Lua scripts, so DOCS/lua_examples/ is not needed anymore.
* TOOLS: add test script for property change notificationswm42014-08-021-0/+16
|
* lua: fix compilation with lua 5.2wm42014-05-261-2/+4
| | | | | | | | | | | Commit e2e450f9 started making use of luaL_register(), but OF COURSE this function disappeared in Lua 5.2, and was replaced with a 5.2-only alternative, slightly different mechanism. So just NIH our own function. This is actually slightly more correct, since it forces the user to call "require" to actually make the module visible for builtin C-only modules other than "mp". Fix autoload.lua accordingly.
* autoload.lua: fix autoloading of files to prependwm42014-05-251-1/+1
| | | | This used the wrong index variable, and thus didn't work.
* TOOLS: add a Lua script to autoload playlist entrieswm42014-05-251-0/+69
| | | | | | This will load other files in the same directory when a single file is played. It's an often requested feature, but we definitely don't want it in the core.
* TOOLS/lua: add cycle-deinterlace-pullup scriptKevin Mitchell2014-05-061-0/+56
| | | | Override the shift+d hotkey to add a pullup step to the cycle.
* TOOLS/lua: conform to whitespace coding-styleKevin Mitchell2014-05-062-24/+24
|
* TOOLS/lua: use double quotes unless there's a good reasonKevin Mitchell2014-05-042-26/+26
|
* TOOLS/lua/autocrop: handle case of user hitting hotkey while cropdetection ↵Kevin Mitchell2014-05-041-3/+11
| | | | already running
* TOOLS/lua: no longer gsub out "lua/" prefix, now that its no longer thereKevin Mitchell2014-05-042-2/+2
|
* TOOLS: better documentation of lua scriptsKevin Mitchell2014-04-293-0/+66
|
* TOOLS: improve autocrop.luaKevin Mitchell2014-04-291-9/+75
| | | | | | | | | | It now inserts no filters and does nothing until the hot-key is pressed. This makes it more suitable to be put in ~/.mpv/lua. When the hot-key is pressed, it now inserts the cropdetect filter and waits 1 second (or a --lua-opts specified duration) before gathering the cropdetect metadata and inserting the appropriate crop filter. A second press of the hotkey removes the crop.
* TOOLS: indent lua scripts by 4 spaces instead of 3Kevin Mitchell2014-04-272-55/+55
|
* TOOLS: add lua/drc-controlKevin Mitchell2014-04-271-0/+80
| | | | allows live insertion/deletion/adjustment of drc audio filter
* TOOLS: move autocrop.lua to TOOLS/luaKevin Mitchell2014-04-271-0/+11
in anticipation of more lua scripts