[MPlayer-cvslog] r24154 - trunk/input/input.c

uau subversion at mplayerhq.hu
Sat Aug 25 06:28:20 CEST 2007


Author: uau
Date: Sat Aug 25 06:28:20 2007
New Revision: 24154

Log:
Handle queued commands from input event functions immediately

Check whether an event handler called mp_input_queue_cmd and return the
command immediately if so. Currently x11_common.c creates commands from
mouse position updates.


Modified:
   trunk/input/input.c

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	(original)
+++ trunk/input/input.c	Sat Aug 25 06:28:20 2007
@@ -1173,6 +1173,8 @@ static mp_cmd_t *read_events(int time, i
 	int code;
 	if (key_fds[i].no_readfunc_retval) {   // getch2 handler special-cased for now
 	    ((void (*)(void))key_fds[i].read_func)();
+	    if (cmd_queue_length)
+		return NULL;
 	    code = mplayer_get_key(0);
 	    if (code < 0)
 		code = MP_INPUT_NOTHING;
@@ -1264,6 +1266,10 @@ mp_input_get_cmd(int time, int paused, i
     if(ret) break;
     from_queue = 0;
     ret = read_events(time, paused);
+    if (!ret) {
+	from_queue = 1;
+	ret = mp_input_get_queued_cmd(peek_only);
+    }
     break;
   }
   if(!ret) return NULL;



More information about the MPlayer-cvslog mailing list