mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
099ae86717
commit
1ffdb9128d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue