-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
defaults.lua: add an exit() function
Scripts can terminate execution by setting mp.keep_running = false. Add an exit() function to wrap setting mp.keep_running and properly expose this feature. It can be used e.g. by a thumbnail script to spawn workers with load-script and then let them quit. It is not added to the mp namespace as mp.exit because that would make it look like it terminates mpv. This mirrors the exit() function which already exists in js. The note in javascript.rst about having to remove key bindings before exit is not kept because they are actually removed automatically since bf385e1 (though it was accurate when the JS backend was developed before upstreaming it).
- Loading branch information
1 parent
e734f5a
commit bb0b9f4
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ local mp_globals = { | |
set_osd_ass = {}, | ||
} | ||
}, | ||
exit = {}, | ||
unpack = {}, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters