mirror of https://github.com/mpv-player/mpv
defaults.js: send the right number of arguments to input.get callbacks
Only send how many arguments were actually passed by console.lua instead of sending extra undefined arguments.
This commit is contained in:
parent
ea6b1119d3
commit
1c3f09270f
|
@ -654,7 +654,7 @@ function register_event_handler(t) {
|
|||
mp.register_script_message("input-event", function (type, args) {
|
||||
if (t[type]) {
|
||||
args = args ? JSON.parse(args) : [];
|
||||
var result = t[type](args[0], args[1]);
|
||||
var result = t[type].apply(null, args);
|
||||
|
||||
if (type == "complete" && result) {
|
||||
mp.commandv("script-message-to", "console", "complete",
|
||||
|
|
Loading…
Reference in New Issue