summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 12:55:23 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 12:55:23 +0300
commit986e519fc9373e2b3dab6f86debcbd7e13466c34 (patch)
tree928eb75d2e6e5685fa468efe4e074a6825a197b9 /mplayer.c
parentb6b82964aa3f9ba93f6f284ed97c278743f50fce (diff)
downloadmpv-986e519fc9373e2b3dab6f86debcbd7e13466c34.tar.bz2
mpv-986e519fc9373e2b3dab6f86debcbd7e13466c34.tar.xz
input: Remove separate mp_input_add_event_fd
Use the same mp_input_add_key_fd for all uses and add a context argument to its callback that was before only in the event fd callbacks. Instead of checking in input.c whether keys were inserted to the keypress FIFO during the callback do the check in the callback before returning and set return value accordingly.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mplayer.c b/mplayer.c
index f429bb6c79..445081b6c5 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2534,9 +2534,10 @@ static int seek(MPContext *mpctx, double amount, int style)
}
-static void read_keys(void *ctx)
+static int read_keys(void *ctx, int fd)
{
getch2();
+ return mplayer_get_key(NULL, 0);
}
@@ -2874,11 +2875,11 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
// Init input system
current_module = "init_input";
mp_input_init(use_gui);
- mp_input_add_key_fd(-1,0,mplayer_get_key,NULL);
+ mp_input_add_key_fd(-1,0,mplayer_get_key,NULL, NULL);
if(slave_mode)
mp_input_add_cmd_fd(0,USE_SELECT,MP_INPUT_SLAVE_CMD_FUNC,NULL);
else if(!noconsolecontrols)
- mp_input_add_event_fd(0, read_keys, NULL);
+ mp_input_add_key_fd(0, 1, read_keys, NULL, NULL);
// Set the libstream interrupt callback
stream_set_interrupt_callback(mp_input_check_interrupt);