From 4666afbf4158537318134374e2230619249424e4 Mon Sep 17 00:00:00 2001 From: Dario Casalinuovo Date: Thu, 11 Feb 2016 18:26:39 +0100 Subject: [PATCH] BMediaEventLooper: Revert recent timeout rework * While on my system it looked like to run well, it introduced a regression on some hardware. I'm reverting it as I don't have a better solution, with the difference that we will do that only for perfomance time events. * Fixes #12624. --- src/kits/media/MediaEventLooper.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp index 0af1a72b63..dd6e43044b 100644 --- a/src/kits/media/MediaEventLooper.cpp +++ b/src/kits/media/MediaEventLooper.cpp @@ -217,7 +217,6 @@ BMediaEventLooper::ControlLoop() bigtime_t waitUntil = B_INFINITE_TIMEOUT; bool hasRealtime = false; bool hasEvent = false; - bool hasBooted = false; // While there are no events or it is not time for the earliest event, // process messages using WaitForMessages. Whenever this funtion times out, @@ -274,14 +273,12 @@ BMediaEventLooper::ControlLoop() fEventQueue.FirstEventTime(), fEventLatency + fSchedulingLatency); - // The first event we handle will have - // a negative startup wait. In this case - // we just check the port and let the - // first event to be executed just now. - if (!hasBooted && waitUntil < 0) { + // TODO: At boot the wait time go + // to negative depending on the system + // speed, this should be fixed. + if (waitUntil < 0) waitUntil = 0; - hasBooted = true; - } + } else if (!hasRealtime) waitUntil = B_INFINITE_TIMEOUT;