diff --git a/input/input.c b/input/input.c index d28d4e231a..e15d4c60bd 100644 --- a/input/input.c +++ b/input/input.c @@ -2056,43 +2056,6 @@ int mp_input_add_thread_src(struct input_ctx *ictx, void *ctx, return 0; } -#define CMD_BUFFER (4 * 4096) - -void mp_input_src_feed_cmd_text(struct mp_input_src *src, char *buf, size_t len) -{ - struct mp_input_src_internal *in = src->in; - if (!in->cmd_buffer) - in->cmd_buffer = talloc_size(in, CMD_BUFFER); - while (len) { - char *next = memchr(buf, '\n', len); - bool term = !!next; - next = next ? next + 1 : buf + len; - size_t copy = next - buf; - bool overflow = copy > CMD_BUFFER - in->cmd_buffer_size; - if (overflow || in->drop) { - in->cmd_buffer_size = 0; - in->drop = overflow || !term; - MP_WARN(src, "Dropping overlong line.\n"); - } else { - memcpy(in->cmd_buffer + in->cmd_buffer_size, buf, copy); - in->cmd_buffer_size += copy; - buf += copy; - len -= copy; - if (term) { - bstr s = {in->cmd_buffer, in->cmd_buffer_size}; - s = bstr_strip(s); - struct mp_cmd *cmd = mp_input_parse_cmd_str(src->log, s, "<>"); - if (cmd) { - input_lock(src->input_ctx); - queue_cmd(src->input_ctx, cmd); - input_unlock(src->input_ctx); - } - in->cmd_buffer_size = 0; - } - } - } -} - void mp_input_set_repeat_info(struct input_ctx *ictx, int rate, int delay) { input_lock(ictx); diff --git a/input/input.h b/input/input.h index 6223c2d576..e7cba063c2 100644 --- a/input/input.h +++ b/input/input.h @@ -78,9 +78,6 @@ int mp_input_add_thread_src(struct input_ctx *ictx, void *ctx, // Set src->cancel and src->uninit (if needed) before calling this. void mp_input_src_init_done(struct mp_input_src *src); -// Feed text data, which will be split into lines of commands. -void mp_input_src_feed_cmd_text(struct mp_input_src *src, char *buf, size_t len); - // Process keyboard input. code is a key code from keycodes.h, possibly // with modifiers applied. MP_INPUT_RELEASE_ALL is also a valid value. void mp_input_put_key(struct input_ctx *ictx, int code);