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

Commit

Permalink
Fix div by 0 crash in stream timing stats (jitter)
Browse files Browse the repository at this point in the history
  • Loading branch information
pstavirs committed Oct 14, 2023
1 parent ebe6aef commit e677dc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/streamtiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ StreamTiming::Stats StreamTiming::stats(uint portId, uint guid)
return stats;

stats.latency = timespecToNsecs(t.sumDelays)/t.countDelays;
stats.jitter = t.sumJitter/(t.countDelays-1);
if (t.countDelays > 1)
stats.jitter = t.sumJitter/(t.countDelays-1);

return stats;
}
Expand Down

0 comments on commit e677dc7

Please sign in to comment.