Fix div by 0 crash in stream timing stats (jitter)

This commit is contained in:
Srivats P 2023-10-14 12:05:21 +05:30
parent ebe6aef62d
commit e677dc7d16

View File

@ -81,6 +81,7 @@ StreamTiming::Stats StreamTiming::stats(uint portId, uint guid)
return stats;
stats.latency = timespecToNsecs(t.sumDelays)/t.countDelays;
if (t.countDelays > 1)
stats.jitter = t.sumJitter/(t.countDelays-1);
return stats;