mirror of
https://github.com/mpv-player/mpv
synced 2024-12-21 22:30:22 +00:00
input: change mp_input_run_cmd signature
I don't like this function at all, but it's basically a trick to get the input's mp_log instance in a case the mp_input_parse_cmd_strv() is almost certainly not going to output anything. But still make it somewhat more consistent with mp_input_parse_cmd_strv() - why force the caller to always use MP_ON_OSD_AUTO?
This commit is contained in:
parent
7c6bb321eb
commit
5d57a338ce
@ -33,7 +33,7 @@ void mp_event_drop_files(struct input_ctx *ictx, int num_files, char **files)
|
||||
files[i],
|
||||
NULL
|
||||
};
|
||||
mp_input_run_cmd(ictx, cmd, "<drop-subtitle>");
|
||||
mp_input_run_cmd(ictx, MP_ON_OSD_AUTO, cmd, "<drop-subtitle>");
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < num_files; i++) {
|
||||
@ -44,7 +44,7 @@ void mp_event_drop_files(struct input_ctx *ictx, int num_files, char **files)
|
||||
(i == 0) ? "replace" : "append",
|
||||
NULL
|
||||
};
|
||||
mp_input_run_cmd(ictx, cmd, "<drop-files>");
|
||||
mp_input_run_cmd(ictx, MP_ON_OSD_AUTO, cmd, "<drop-files>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1661,11 +1661,9 @@ struct mp_cmd *mp_input_parse_cmd(struct input_ctx *ictx, bstr str,
|
||||
return mp_input_parse_cmd_(ictx->log, str, location);
|
||||
}
|
||||
|
||||
void mp_input_run_cmd(struct input_ctx *ictx, const char **cmd,
|
||||
void mp_input_run_cmd(struct input_ctx *ictx, int def_flags, const char **cmd,
|
||||
const char *location)
|
||||
{
|
||||
mp_cmd_t *cmdt = mp_input_parse_cmd_strv(ictx->log,
|
||||
MP_ON_OSD_AUTO,
|
||||
cmd, location);
|
||||
mp_cmd_t *cmdt = mp_input_parse_cmd_strv(ictx->log, def_flags, cmd, location);
|
||||
mp_input_queue_cmd(ictx, cmdt);
|
||||
}
|
||||
|
@ -210,8 +210,8 @@ int mp_input_check_interrupt(struct input_ctx *ictx, int time);
|
||||
// characters. If false, count Right Alt as the modifier Alt key.
|
||||
bool mp_input_use_alt_gr(struct input_ctx *ictx);
|
||||
|
||||
// Runs a command parsing the input string array
|
||||
void mp_input_run_cmd(struct input_ctx *ictx, const char **cmd,
|
||||
// Like mp_input_parse_cmd_strv, but also run the command.
|
||||
void mp_input_run_cmd(struct input_ctx *ictx, int def_flags, const char **cmd,
|
||||
const char *location);
|
||||
|
||||
extern int async_quit_request;
|
||||
|
Loading…
Reference in New Issue
Block a user