summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-19 18:44:03 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commitb3968ecf05c11cf42c8120be3a1d716c4cc71b5d (patch)
tree63001fbaf2769ff7435d0794df0ee7f8c718f497 /input/input.c
parentdbcd654e612ca32673cf2703758b05700cb87d03 (diff)
downloadmpv-b3968ecf05c11cf42c8120be3a1d716c4cc71b5d.tar.bz2
mpv-b3968ecf05c11cf42c8120be3a1d716c4cc71b5d.tar.xz
input: remove now unused "abort command" and cancel infrastructure
The previous commit removed all uses.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/input/input.c b/input/input.c
index 20c39dd4ac..c8f1a64ad5 100644
--- a/input/input.c
+++ b/input/input.c
@@ -153,9 +153,6 @@ struct input_ctx {
struct cmd_queue cmd_queue;
- void (*cancel)(void *cancel_ctx);
- void *cancel_ctx;
-
void (*wakeup_cb)(void *ctx);
void *wakeup_ctx;
};
@@ -531,13 +528,11 @@ static void release_down_cmd(struct input_ctx *ictx, bool drop_current)
}
// We don't want the append to the command queue indefinitely, because that
-// could lead to situations where recovery would take too long. On the other
-// hand, don't drop commands that will abort playback.
+// could lead to situations where recovery would take too long.
static bool should_drop_cmd(struct input_ctx *ictx, struct mp_cmd *cmd)
{
struct cmd_queue *queue = &ictx->cmd_queue;
- return queue_count_cmds(queue) >= ictx->opts->key_fifo_size &&
- !mp_input_is_abort_cmd(cmd);
+ return queue_count_cmds(queue) >= ictx->opts->key_fifo_size;
}
static struct mp_cmd *resolve_key(struct input_ctx *ictx, int code)
@@ -883,26 +878,10 @@ static void adjust_max_wait_time(struct input_ctx *ictx, double *time)
}
}
-static bool test_abort_cmd(struct input_ctx *ictx, struct mp_cmd *new)
-{
- if (!mp_input_is_maybe_abort_cmd(new))
- return false;
- if (mp_input_is_abort_cmd(new))
- return true;
- // Abort only if there are going to be at least 2 commands in the queue.
- for (struct mp_cmd *cmd = ictx->cmd_queue.first; cmd; cmd = cmd->queue_next) {
- if (mp_input_is_maybe_abort_cmd(cmd))
- return true;
- }
- return false;
-}
-
int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
{
input_lock(ictx);
if (cmd) {
- if (ictx->cancel && test_abort_cmd(ictx, cmd))
- ictx->cancel(ictx->cancel_ctx);
queue_add_tail(&ictx->cmd_queue, cmd);
mp_input_wakeup(ictx);
}
@@ -1423,14 +1402,6 @@ void mp_input_uninit(struct input_ctx *ictx)
talloc_free(ictx);
}
-void mp_input_set_cancel(struct input_ctx *ictx, void (*cb)(void *c), void *c)
-{
- input_lock(ictx);
- ictx->cancel = cb;
- ictx->cancel_ctx = c;
- input_unlock(ictx);
-}
-
bool mp_input_use_alt_gr(struct input_ctx *ictx)
{
input_lock(ictx);