Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit e677dc7

Browse files
committed
Fix div by 0 crash in stream timing stats (jitter)
1 parent ebe6aef commit e677dc7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/streamtiming.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ StreamTiming::Stats StreamTiming::stats(uint portId, uint guid)
8181
return stats;
8282

8383
stats.latency = timespecToNsecs(t.sumDelays)/t.countDelays;
84-
stats.jitter = t.sumJitter/(t.countDelays-1);
84+
if (t.countDelays > 1)
85+
stats.jitter = t.sumJitter/(t.countDelays-1);
8586

8687
return stats;
8788
}

0 commit comments

Comments
 (0)