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.
This commit is contained in:
nanahi 2024-04-07 10:18:08 -04:00 committed by Kacper Michajłow
parent b7ad0968ad
commit dbe377645f
1 changed files with 7 additions and 6 deletions

View File

@ -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);