mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
修复获取webrtc推流丢包率除0的bug
This commit is contained in:
parent
f6b4eb418f
commit
df7a3242bb
@ -612,11 +612,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getLossRate() {
|
int getLossRate() {
|
||||||
if (!_rtcp_context.getExpectedPacketsInterval()) {
|
auto expected = _rtcp_context.getExpectedPacketsInterval();
|
||||||
//_rtcp_context.getExpectedPacketsInterval()取值总为零?
|
if (!expected) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return _rtcp_context.geLostInterval() * 100 / _rtcp_context.getExpectedPacketsInterval();
|
return _rtcp_context.geLostInterval() * 100 / expected;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user