diff options
Diffstat (limited to 'input/input.c')
-rw-r--r-- | input/input.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c index 95de21775f..66484fa20f 100644 --- a/input/input.c +++ b/input/input.c @@ -1367,3 +1367,26 @@ static int mp_input_print_cmd_list(config_t* cfg) { } exit(0); } + +int +mp_input_check_interrupt(int time) { + mp_cmd_t* cmd; + if((cmd = mp_input_get_cmd(time,0)) == NULL) + return 0; + switch(cmd->id) { + case MP_CMD_QUIT: + case MP_CMD_PLAY_TREE_STEP: + case MP_CMD_PLAY_TREE_UP_STEP: + case MP_CMD_PLAY_ALT_SRC_STEP: + // The cmd will be executed when we are back in the main loop + if(! mp_input_queue_cmd(cmd)) { + mp_msg(MSGT_INPUT,MSGL_ERR,"mpdemux_check_interrupt: can't queue cmd %s\n",cmd->name); + mp_cmd_free(cmd); + } + return 1; + } + mp_cmd_free(cmd); + return 0; +} + + |