Skip to content

Commit 2137334

Browse files
committed
Only count publishers that are sending at least 64 kbit/s.
1 parent 0d46485 commit 2137334

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clientsession.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ var (
4545
// The "/api/v1/signaling/" URL will be changed to use "v3" as the "signaling-v3"
4646
// feature is returned by the capabilities endpoint.
4747
PathToOcsSignalingBackend = "ocs/v2.php/apps/spreed/api/v1/signaling/backend"
48+
49+
// minBandwidthOfActivePublisher is the bandwidth a publisher must be sending
50+
// to be counted as "active".
51+
minBandwidthOfActivePublisher = api.BandwidthFromBits(64 * 1024)
4852
)
4953

5054
const (
@@ -1546,7 +1550,9 @@ func (s *ClientSession) Bandwidth() (uint32, uint32, *McuClientBandwidthInfo) {
15461550

15471551
bandwidth.Received += bw.Received
15481552
bandwidth.Sent += bw.Sent
1549-
publishers++
1553+
if bw.Received >= minBandwidthOfActivePublisher {
1554+
publishers++
1555+
}
15501556
}
15511557
}
15521558
}

0 commit comments

Comments
 (0)