Skip to content

Commit

Permalink
[core] Fixing division by 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
npanhaleux committed Aug 26, 2024
1 parent 85161cf commit 1fb7fab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion srtcore/buffer_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ void CMovingRateEstimator::computeAverageValue()
newRateBps += (m_Samples[i].m_iBytesCount + (CPacket::HDR_SIZE * m_Samples[i].m_iPktsCount));

if (isFirstPeriod)
newRateBps = newRateBps * 1000 / startDelta;
newRateBps = newRateBps * SAMPLE_DURATION_MS * NUM_PERIODS / max(1, startDelta);

m_iRateBps = newRateBps;
}
Expand Down

0 comments on commit 1fb7fab

Please sign in to comment.