BMediaEventLooper: Handle events in past differently
* When the loop didn't handle an event in performance time, we will attempt at reading the port only if there are messages using a null timeout.
This commit is contained in:
@@ -269,13 +269,6 @@ BMediaEventLooper::ControlLoop()
|
|||||||
waitUntil = TimeSource()->RealTimeFor(
|
waitUntil = TimeSource()->RealTimeFor(
|
||||||
fEventQueue.FirstEventTime(),
|
fEventQueue.FirstEventTime(),
|
||||||
fEventLatency + fSchedulingLatency);
|
fEventLatency + fSchedulingLatency);
|
||||||
|
|
||||||
// TODO: At boot the wait time go
|
|
||||||
// to negative depending on the system
|
|
||||||
// speed, this should be fixed.
|
|
||||||
if (waitUntil < 0)
|
|
||||||
waitUntil = 0;
|
|
||||||
|
|
||||||
} else if (!hasRealtime)
|
} else if (!hasRealtime)
|
||||||
waitUntil = B_INFINITE_TIMEOUT;
|
waitUntil = B_INFINITE_TIMEOUT;
|
||||||
|
|
||||||
@@ -289,7 +282,12 @@ BMediaEventLooper::ControlLoop()
|
|||||||
} else
|
} else
|
||||||
hasRealtime = false;
|
hasRealtime = false;
|
||||||
}
|
}
|
||||||
err = WaitForMessage(waitUntil);
|
|
||||||
|
if (waitUntil != B_INFINITE_TIMEOUT
|
||||||
|
&& TimeSource()->RealTime() >= waitUntil) {
|
||||||
|
err = WaitForMessage(0);
|
||||||
|
} else
|
||||||
|
err = WaitForMessage(waitUntil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user