Mercurial > mplayer.hg
comparison osdep/getch2-win.c @ 18070:c1e25c011c54
getch2 should wait for input. Fixes 100% CPU usage during cache fill.
author | reimar |
---|---|
date | Mon, 10 Apr 2006 12:42:10 +0000 |
parents | 3d02f6e2a432 |
children | 24003616a623 |
comparison
equal
deleted
inserted
replaced
18069:b644dfdeda48 | 18070:c1e25c011c54 |
---|---|
34 INPUT_RECORD eventbuffer[128]; | 34 INPUT_RECORD eventbuffer[128]; |
35 DWORD retval; | 35 DWORD retval; |
36 int i=0; | 36 int i=0; |
37 if(!getch2_status)return -1; | 37 if(!getch2_status)return -1; |
38 /*check if there are input events*/ | 38 /*check if there are input events*/ |
39 WaitForSingleObject(stdin, time); | |
39 if(!GetNumberOfConsoleInputEvents(stdin,&retval)) | 40 if(!GetNumberOfConsoleInputEvents(stdin,&retval)) |
40 { | 41 { |
41 printf("getch2: can't get number of input events: %i\n",GetLastError()); | 42 printf("getch2: can't get number of input events: %i\n",GetLastError()); |
42 return -1; | 43 return -1; |
43 } | 44 } |