From 5bbd734fffde5f0d689216c07dfeb3508aeb1f57 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Nov 2014 15:30:36 +0100 Subject: [PATCH] command: don't queue framesteps If repeated framestep commands are sent, just unpause the player, instead of playing N frames for N repeated commands. --- input/input.c | 1 + player/command.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/input/input.c b/input/input.c index 7c647adef3..3a2bbbc4e5 100644 --- a/input/input.c +++ b/input/input.c @@ -537,6 +537,7 @@ static bool key_updown_ok(enum mp_command_type cmd) { switch (cmd) { case MP_CMD_SCRIPT_BINDING: + case MP_CMD_FRAME_STEP: return true; default: return false; diff --git a/player/command.c b/player/command.c index 0042d8dee7..90adf003eb 100644 --- a/player/command.c +++ b/player/command.c @@ -4113,7 +4113,20 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_FRAME_STEP: if (!mpctx->num_sources) return -1; - add_step_frame(mpctx, 1); + if (cmd->is_up_down) { + if (cmd->is_up) { + if (mpctx->step_frames < 1) + pause_player(mpctx); + } else { + if (cmd->repeated) { + unpause_player(mpctx); + } else { + add_step_frame(mpctx, 1); + } + } + } else { + add_step_frame(mpctx, 1); + } break; case MP_CMD_FRAME_BACK_STEP: