[MPlayer-dev-eng] [PATCH] timer-darwin.c fix hang when using -cache

Nicolas Plourde nicolas.plourde at sympatico.ca
Wed Oct 27 01:20:27 CEST 2004


Im still looking to resolve this issue. Anyone care to comment on this 
patch?
the problem is that mach_wait_until() hang from time to time.

Index: osdep/timer-darwin.c
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/timer-darwin.c,v
retrieving revision 1.4
diff -u -r1.4 timer-darwin.c
--- osdep/timer-darwin.c	4 Aug 2004 15:48:43 -0000	1.4
+++ osdep/timer-darwin.c	26 Oct 2004 23:17:27 -0000
@@ -32,20 +32,12 @@

  const char *timer_name = "Darwin accurate";

-/* the core sleep function, uses floats and is used in MPlayer G2 */
-float sleep_accurate(float time_frame)
-{
-  uint64_t deadline = time_frame / timebase_ratio + 
mach_absolute_time();
-
-  mach_wait_until(deadline);

-  return (mach_absolute_time() - deadline) * timebase_ratio;
-}

  /* wrapper for MPlayer G1 */
  int usec_sleep(int usec_delay)
  {
-  return sleep_accurate(usec_delay / 1e6) * 1e6;
+  return usleep(usec_delay);
  }

====
Nicolas Plourde <nicolas.plourde at sympatico.ca>




More information about the MPlayer-dev-eng mailing list