summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCogentRedTester <cogent.redtester@outlook.com>2022-06-22 21:09:49 +0930
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2022-06-22 14:44:52 +0300
commit1ffdb9128d87dffe869c1e9f4024a16bfd0022c4 (patch)
treef904e2ca0ec4220b5801225c09bd1f8849a463e3
parent099ae8671732a333216a622cba7751f08deff9af (diff)
downloadmpv-1ffdb9128d87dffe869c1e9f4024a16bfd0022c4.tar.bz2
mpv-1ffdb9128d87dffe869c1e9f4024a16bfd0022c4.tar.xz
lua: command_native_async: make the callback optional
The documentation states that the callback is optional, but it actually was not. Now it's optional, as docuented.
-rw-r--r--player/lua/defaults.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua
index dcbb4e0f62..e0914115f5 100644
--- a/player/lua/defaults.lua
+++ b/player/lua/defaults.lua
@@ -615,6 +615,7 @@ local async_next_id = 1
function mp.command_native_async(node, cb)
local id = async_next_id
async_next_id = async_next_id + 1
+ cb = cb or function() end
local res, err = mp.raw_command_native_async(id, node)
if not res then
mp.add_timeout(0, function() cb(false, nil, err) end)