diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-08 21:40:44 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-08 21:40:44 +0000 |
commit | 876b028289c88748dd9c3e54d4a83e29a1c9e13b (patch) | |
tree | c495b6f191c2a13ccce8bb7d3ad1fc6c1532c928 /input | |
parent | 87340de57f001076cd8bac0f7b638cc667bf17c3 (diff) | |
download | mpv-876b028289c88748dd9c3e54d4a83e29a1c9e13b.tar.bz2 mpv-876b028289c88748dd9c3e54d4a83e29a1c9e13b.tar.xz |
Do not use exit_player in the signal handler, this code just can not
be called from a signal handler.
Instead only make the input system generate quit commands for the first
CTRL+C and otherwise do getch2_disable and exit.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25651 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 4 | ||||
-rw-r--r-- | input/input.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c index d1cf960991..ae8394074b 100644 --- a/input/input.c +++ b/input/input.c @@ -541,6 +541,8 @@ static mp_cmd_filter_t* cmd_filters = NULL; // Callback to allow the menu filter to grab the incoming keys int (*mp_input_key_cb)(int code) = NULL; +int async_quit_request; + static mp_input_fd_t key_fds[MP_MAX_KEY_FD]; static unsigned int num_key_fd = 0; static mp_input_fd_t cmd_fds[MP_MAX_CMD_FD]; @@ -1312,6 +1314,8 @@ mp_input_get_cmd(int time, int paused, int peek_only) { mp_cmd_filter_t* cf; int from_queue; + if (async_quit_request) + return mp_input_parse_cmd("quit 1"); while(1) { from_queue = 1; ret = mp_input_get_queued_cmd(peek_only); diff --git a/input/input.h b/input/input.h index dfbdd4b136..1cfb4b23ed 100644 --- a/input/input.h +++ b/input/input.h @@ -298,4 +298,6 @@ mp_input_uninit(void); int mp_input_check_interrupt(int time); +extern int async_quit_request; + #endif /* INPUT_H */ |