mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 04:18:28 +02:00
fix for PacketTimeWindow calculations
This commit is contained in:
parent
f9c8f30083
commit
e39611dc1c
1 changed files with 3 additions and 2 deletions
|
@ -48,14 +48,15 @@ int32_t meanOfMedianFilteredValues(std::vector<int> intervals, int numValues, in
|
||||||
int lowerBound = median / MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
int lowerBound = median / MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
||||||
|
|
||||||
for (auto& interval : intervals) {
|
for (auto& interval : intervals) {
|
||||||
if ((interval < upperBound) && interval > lowerBound) {
|
if ((interval < upperBound) && (interval > lowerBound)) {
|
||||||
++count;
|
++count;
|
||||||
sum += interval;
|
sum += interval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count >= valuesRequired) {
|
if (count >= valuesRequired) {
|
||||||
return (int32_t) ceil((double) USECS_PER_MSEC / ((double) sum) / ((double) count));
|
static const double USECS_PER_SEC = 1000000;
|
||||||
|
return (int32_t) ceil(USECS_PER_SEC / ((double) sum) / ((double) count));
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue