mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
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:
parent
40fd57238c
commit
b48947fc65
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user