mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 23:07:02 +00:00
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:
parent
b7ad0968ad
commit
dbe377645f
@ -275,13 +275,12 @@ static struct mp_cmd *queue_peek_tail(struct cmd_queue *queue)
|
|||||||
return cur;
|
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) {
|
if (!cmd)
|
||||||
queue_add_tail(&ictx->cmd_queue, cmd);
|
return;
|
||||||
mp_input_wakeup(ictx);
|
queue_add_tail(&ictx->cmd_queue, cmd);
|
||||||
}
|
mp_input_wakeup(ictx);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void append_bind_info(struct input_ctx *ictx, char **pmsg,
|
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)
|
int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
|
||||||
{
|
{
|
||||||
|
if (!cmd)
|
||||||
|
return 0;
|
||||||
input_lock(ictx);
|
input_lock(ictx);
|
||||||
queue_cmd(ictx, cmd);
|
queue_cmd(ictx, cmd);
|
||||||
input_unlock(ictx);
|
input_unlock(ictx);
|
||||||
|
Loading…
Reference in New Issue
Block a user