mirror of https://github.com/mpv-player/mpv
1 - Remove kernel HZ=100 assumptions that are no longer true from
timing. Patch by Uoti Urpala git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18241 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2fe6f2eefe
commit
1d62695562
15
mplayer.c
15
mplayer.c
|
@ -3789,15 +3789,14 @@ if(time_frame>0.001 && !(vo_flags&256)){
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
// -------- TIMER + SOFTSLEEP -----------
|
// -------- TIMER + SOFTSLEEP -----------
|
||||||
float min=softsleep?0.021:0.005;
|
// assume kernel HZ=100 for softsleep, works with larger HZ but with
|
||||||
|
// unnecessarily high CPU usage
|
||||||
|
float margin = softsleep ? 0.011 : 0;
|
||||||
current_module="sleep_timer";
|
current_module="sleep_timer";
|
||||||
while(time_frame>min){
|
while (time_frame > margin) {
|
||||||
if(time_frame<=0.020)
|
usec_sleep(1000000 * (time_frame - margin));
|
||||||
usec_sleep(0); // sleeps 1 clock tick (10ms)!
|
time_frame -= GetRelativeTime();
|
||||||
else
|
}
|
||||||
usec_sleep(1000000*(time_frame-0.020));
|
|
||||||
time_frame-=GetRelativeTime();
|
|
||||||
}
|
|
||||||
if(softsleep){
|
if(softsleep){
|
||||||
current_module="sleep_soft";
|
current_module="sleep_soft";
|
||||||
if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, MSGTR_SoftsleepUnderflow);
|
if(time_frame<0) mp_msg(MSGT_AVSYNC, MSGL_WARN, MSGTR_SoftsleepUnderflow);
|
||||||
|
|
Loading…
Reference in New Issue