summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/input/input.c b/input/input.c
index 20c39dd4ac..9e96da267d 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);
}
@@ -1391,8 +1370,11 @@ void mp_input_load_config(struct input_ctx *ictx)
}
#if HAVE_WIN32_PIPES
- if (ictx->global->opts->input_file && *ictx->global->opts->input_file)
- mp_input_pipe_add(ictx, ictx->global->opts->input_file);
+ char *ifile;
+ mp_read_option_raw(ictx->global, "input-file", &m_option_type_string, &ifile);
+ if (ifile && ifile[0])
+ mp_input_pipe_add(ictx, ifile);
+ talloc_free(ifile);
#endif
input_unlock(ictx);
@@ -1423,14 +1405,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);