mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
getch2 should wait for input. Fixes 100% CPU usage during cache fill.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18071 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
bb2203a63c
commit
cfcf67ee5e
@ -36,6 +36,7 @@ int getch2(int time){
|
|||||||
int i=0;
|
int i=0;
|
||||||
if(!getch2_status)return -1;
|
if(!getch2_status)return -1;
|
||||||
/*check if there are input events*/
|
/*check if there are input events*/
|
||||||
|
WaitForSingleObject(stdin, time);
|
||||||
if(!GetNumberOfConsoleInputEvents(stdin,&retval))
|
if(!GetNumberOfConsoleInputEvents(stdin,&retval))
|
||||||
{
|
{
|
||||||
printf("getch2: can't get number of input events: %i\n",GetLastError());
|
printf("getch2: can't get number of input events: %i\n",GetLastError());
|
||||||
|
Loading…
Reference in New Issue
Block a user