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 authored and Kacper Michajłow committed 2024-04-17 23:42:35 +02:00
1 parent b7ad0968ad
commit dbe377645f
1 file changed
+7 -6
+7 -6
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);