From bf3c311ee84e177253c033b84144bbd367d42a86 Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 23 Oct 2002 14:46:20 +0000 Subject: mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7863 b3059339-0415-0410-9bf9-f77b7e298cf2 --- input/input.c | 23 +++++++++++++++++++++++ input/input.h | 5 +++++ 2 files changed, 28 insertions(+) (limited to 'input') 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; +} + + diff --git a/input/input.h b/input/input.h index 9cff8ca7b4..27a73e62d3 100644 --- a/input/input.h +++ b/input/input.h @@ -171,3 +171,8 @@ mp_input_init(void); void mp_input_uninit(void); + +// Interruptible usleep: (used by libmpdemux) +int +mp_input_check_interrupt(int time); + -- cgit v1.2.3