|
|
@@ -601,14 +601,13 @@ StatsCollector.prototype.processStatsReport = function () {
|
|
601
|
601
|
var packetsLostBefore = getStatValue(before, 'packetsLost');
|
|
602
|
602
|
if (!packetsLostBefore || packetsBefore < 0)
|
|
603
|
603
|
packetsLostBefore = 0;
|
|
604
|
|
- var lossRate = packetsLostNow - packetsLostBefore;
|
|
605
|
|
- if (!lossRate || lossRate < 0)
|
|
606
|
|
- lossRate = 0;
|
|
607
|
|
- var packetsTotal = (packetsDiff + lossRate);
|
|
|
604
|
+ var packetsLostDiff = Math.max(0, packetsLostNow - packetsLostBefore);
|
|
|
605
|
+
|
|
|
606
|
+ var packetsTotal = packetsDiff + packetsLostDiff;
|
|
608
|
607
|
|
|
609
|
608
|
ssrcStats.setSsrcLoss({
|
|
610
|
609
|
packetsTotal: packetsTotal,
|
|
611
|
|
- packetsLost: lossRate,
|
|
|
610
|
+ packetsLost: packetsLostDiff,
|
|
612
|
611
|
isDownloadStream: isDownloadStream
|
|
613
|
612
|
});
|
|
614
|
613
|
|