mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
command: don't queue framesteps
If repeated framestep commands are sent, just unpause the player, instead of playing N frames for N repeated commands.
This commit is contained in:
@@ -537,6 +537,7 @@ static bool key_updown_ok(enum mp_command_type cmd)
|
|||||||
{
|
{
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case MP_CMD_SCRIPT_BINDING:
|
case MP_CMD_SCRIPT_BINDING:
|
||||||
|
case MP_CMD_FRAME_STEP:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -4113,7 +4113,20 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||||||
case MP_CMD_FRAME_STEP:
|
case MP_CMD_FRAME_STEP:
|
||||||
if (!mpctx->num_sources)
|
if (!mpctx->num_sources)
|
||||||
return -1;
|
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;
|
break;
|
||||||
|
|
||||||
case MP_CMD_FRAME_BACK_STEP:
|
case MP_CMD_FRAME_BACK_STEP:
|
||||||
|
|||||||
Reference in New Issue
Block a user