mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
repair anomalies in timing table
This commit is contained in:
parent
9cb6ccaa46
commit
4b6b34836d
1 changed files with 14 additions and 1 deletions
|
@ -677,8 +677,21 @@ void NodeList::flagTimeForConnectionStep(NodeList::ConnectionStep connectionStep
|
|||
_lastConnectionTimes.clear();
|
||||
}
|
||||
|
||||
// we only add a timestamp on the first call for each NodeList::ConnectionStep
|
||||
if (!_lastConnectionTimes.contains(connectionStep)) {
|
||||
// if there is no time for existing step add a timestamp on the first call for each NodeList::ConnectionStep
|
||||
_lastConnectionTimes[connectionStep] = timestamp;
|
||||
} else {
|
||||
// if the existing time for this step is before the nearest sibling before then replace it
|
||||
// this handles the case where audio comes in after an address lookup after the previous times have been cleared
|
||||
quint64 currentTime = _lastConnectionTimes[connectionStep];
|
||||
|
||||
// go down the sibling steps and check if the registered time is actually before the sibling
|
||||
for (int i = ((int) connectionStep) - 1; i >= 0; i--) {
|
||||
NodeList::ConnectionStep thisStep = static_cast<NodeList::ConnectionStep>(i);
|
||||
if (_lastConnectionTimes.contains(thisStep) && _lastConnectionTimes[thisStep] >= currentTime) {
|
||||
_lastConnectionTimes[connectionStep] = timestamp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue