diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-04-07 10:18:08 -0400 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-17 23:42:35 +0200 |
commit | dbe377645f11a5bd253e48df1ae69f960499fcd8 (patch) | |
tree | 66e667660bf081871ee2928c248cba1c3467d1b6 /input/input.c | |
parent | b7ad0968ad3e4fde2112b146c51eea7832b6bd8f (diff) | |
download | mpv-dbe377645f11a5bd253e48df1ae69f960499fcd8.tar.bz2 mpv-dbe377645f11a5bd253e48df1ae69f960499fcd8.tar.xz |
input: make mp_input_queue_cmd return a meaningful value
It's currently always a meaningless 1. Make it so it returns 0 is cmd
is NULL. Remove the unused return value from queue_cmd.
Diffstat (limited to 'input/input.c')
-rw-r--r-- | input/input.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/input/input.c b/input/input.c index d58e5e9208..d4cea80853 100644 --- a/input/input.c +++ b/input/input.c @@ -275,13 +275,12 @@ static struct mp_cmd *queue_peek_tail(struct cmd_queue *queue) return cur; } -static int queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) +static void queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) { - if (cmd) { - queue_add_tail(&ictx->cmd_queue, cmd); - mp_input_wakeup(ictx); - } - return 1; + if (!cmd) + return; + queue_add_tail(&ictx->cmd_queue, cmd); + mp_input_wakeup(ictx); } static void append_bind_info(struct input_ctx *ictx, char **pmsg, @@ -957,6 +956,8 @@ static void adjust_max_wait_time(struct input_ctx *ictx, double *time) int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) { + if (!cmd) + return 0; input_lock(ictx); queue_cmd(ictx, cmd); input_unlock(ictx); |