mirror of
https://github.com/mpv-player/mpv
synced 2025-04-22 15:17:43 +00:00
Fix the prevent system idle code. Original code also works, but not as expected.
The update function was always called, but it should only be called every 30 seconds. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24982 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
51cd2b0394
commit
ac78bc4eca
@ -898,7 +898,7 @@ static void draw_osd(void)
|
|||||||
static void flip_page(void)
|
static void flip_page(void)
|
||||||
{
|
{
|
||||||
int curTime;
|
int curTime;
|
||||||
static int lastTime;
|
static int lastTime = 0;
|
||||||
|
|
||||||
if(theWindow == NULL)
|
if(theWindow == NULL)
|
||||||
return;
|
return;
|
||||||
@ -984,9 +984,8 @@ static void flip_page(void)
|
|||||||
//update activity every 30 seconds to prevent
|
//update activity every 30 seconds to prevent
|
||||||
//screensaver from starting up.
|
//screensaver from starting up.
|
||||||
curTime = TickCount()/60;
|
curTime = TickCount()/60;
|
||||||
lastTime = 0;
|
|
||||||
|
|
||||||
if( ((curTime/ - lastTime) >= 5) || (lastTime == 0) )
|
if( ((curTime - lastTime) >= 30) || (lastTime == 0) )
|
||||||
{
|
{
|
||||||
UpdateSystemActivity(UsrActivity);
|
UpdateSystemActivity(UsrActivity);
|
||||||
lastTime = curTime;
|
lastTime = curTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user