changeset 17546:d878e3e313eb

let osx sleep if video is paused
author nplourde
date Tue, 07 Feb 2006 01:36:32 +0000
parents a80e7a9862c6
children 114699930136
files libvo/vo_macosx.m libvo/vo_quartz.c
diffstat 2 files changed, 30 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_macosx.m	Tue Feb 07 00:01:38 2006 +0000
+++ b/libvo/vo_macosx.m	Tue Feb 07 01:36:32 2006 +0000
@@ -722,6 +722,21 @@
 			lastTime = curTime;
 		}
 	}
+	
+	//update activity every 60 seconds to prevent
+	//screensaver from starting up.
+	DateTimeRec d;
+	unsigned long curTime;
+	static unsigned long lastTime = 0;
+	
+	GetTime(&d);
+	DateToSeconds( &d, &curTime);
+	
+	if( ( (curTime - lastTime) >= 60) || (lastTime == 0))
+	{
+		UpdateSystemActivity(UsrActivity);
+		lastTime = curTime;
+	}
 }
 
 /*
@@ -849,21 +864,6 @@
 {
 	event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0.0001] inMode:NSEventTrackingRunLoopMode dequeue:YES];
 	[NSApp sendEvent:event];
-	
-	//update activity every 60 seconds to prevent
-	//screensaver from starting up.
-	DateTimeRec d;
-	unsigned long curTime;
-	static unsigned long lastTime = 0;
-	
-	GetTime(&d);
-	DateToSeconds( &d, &curTime);
-	
-	if( ( (curTime - lastTime) >= 60) || (lastTime == 0))
-	{
-		UpdateSystemActivity(UsrActivity);
-		lastTime = curTime;
-	}
 }
 
 /*
--- a/libvo/vo_quartz.c	Tue Feb 07 00:01:38 2006 +0000
+++ b/libvo/vo_quartz.c	Tue Feb 07 01:36:32 2006 +0000
@@ -888,21 +888,6 @@
 		SendEventToEventTarget (theEvent, theTarget);
 		ReleaseEvent(theEvent);
 	}
-
-	//update activity every 30 seconds to prevent
-	//screensaver from starting up.
-	DateTimeRec d;
-	unsigned long curTime;
-	static unsigned long lastTime = 0;
-	
-	GetTime(&d);
-	DateToSeconds( &d, &curTime);
-	
-	if( ( (curTime - lastTime) >= 30) || (lastTime == 0))
-	{
-		UpdateSystemActivity(UsrActivity);
-		lastTime = curTime;
-	}
 }
 
 static void draw_osd(void)
@@ -996,6 +981,21 @@
 			lastTime = curTime;
 		}
 	}
+
+	//update activity every 30 seconds to prevent
+	//screensaver from starting up.
+	DateTimeRec d;
+	unsigned long curTime;
+	static unsigned long lastTime = 0;
+	
+	GetTime(&d);
+	DateToSeconds( &d, &curTime);
+	
+	if( ( (curTime - lastTime) >= 30) || (lastTime == 0))
+	{
+		UpdateSystemActivity(UsrActivity);
+		lastTime = curTime;
+	}
 }
 
 static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)