diff mplayer.c @ 15288:7fc3a521d42b

use darwin accurate timer
author nplourde
date Fri, 29 Apr 2005 10:48:32 +0000
parents 39eb8a327ea9
children cec4a515061f
line wrap: on
line diff
--- a/mplayer.c	Thu Apr 28 23:08:16 2005 +0000
+++ b/mplayer.c	Fri Apr 29 10:48:32 2005 +0000
@@ -1045,6 +1045,8 @@
 
   srand((int) time(NULL)); 
 
+  InitTimer();
+  
   mp_msg_init();
   mp_msg_set_level(MSGL_STATUS);
 
@@ -2214,8 +2216,6 @@
 
 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_StartPlaying);fflush(stdout);
 
-InitTimer();
-
 #ifdef USE_DVDNAV
 if (stream->type==STREAMTYPE_DVDNAV) {
   dvdnav_stream_fullstart((dvdnav_priv_t *)stream->priv);
@@ -2457,6 +2457,15 @@
 	}
     } else
 #endif
+#ifdef SYS_DARWIN
+    {
+		current_module="sleep_darwin";
+        while(time_frame>0.005) {
+			usec_sleep(1000000*time_frame);
+			time_frame-=GetRelativeTime();
+        }
+	}
+#else
     {
 	// -------- TIMER + SOFTSLEEP -----------
 	float min=softsleep?0.021:0.005;
@@ -2474,7 +2483,7 @@
 	    while(time_frame>0) time_frame-=GetRelativeTime(); // burn the CPU
 	}
     }
-
+#endif
 }
 
 //if(!frame_time_remaining){	// should we display the frame now?