repace call to sleep_accurate to usleep which fix hang while using -cache option on osx

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13777 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nplourde 2004-10-27 18:03:11 +00:00
parent 40fd57238c
commit b48947fc65
1 changed files with 1 additions and 9 deletions

View File

@ -32,20 +32,12 @@ static double timebase_ratio;
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);
}