<!-- Come join our community on Slack https://pion.ly/slack for quicker support and more resources We also provide a Knowledge Base https://pion.ly/knowledge-base that covers Pion and general WebRTC We maintain a FAQ of common issues and questions https://pion.ly/knowledge-base/pion-basics/faq/ Please answer these questions before submitting your issue. Thanks! --> ### Your environment. - Version: *SHA:3e913c713bbe7cc15da000b7b2040094d8c53825* - Browser: *v0.4.0* - Other Information - *stacktraces, related issues, suggestions how to fix, links for us to have context* ### What did you do? <!-- If possible, provide an example for reproducing the error. A complete runnable program is good. --> - file:client.go func (c *Client) getBandWidth(cycle int) (int, int) { var recvBW, sendBW int if c.producer != nil { sendBW = c.producer.GetSendBandwidth(cycle) } recvBW = c.recvByte / cycle / 1000 c.recvByte = 0 return recvBW, sendBW } - file:webmproducer.go // GetSendBandwidth calc the sending bandwidth with cycle(s) func (t *WebMProducer) GetSendBandwidth(cycle int) int { bw := t.sendByte / cycle / 1000 t.sendByte = 0 return bw } - fixed recvBW = c.recvByte / cycle / 1024 bw := t.sendByte / cycle / 1024 ### What did you expect? ### What happened?
Your environment.
What did you do?
file:client.go
func (c *Client) getBandWidth(cycle int) (int, int) {
var recvBW, sendBW int
if c.producer != nil {
sendBW = c.producer.GetSendBandwidth(cycle)
}
recvBW = c.recvByte / cycle / 1000
c.recvByte = 0
return recvBW, sendBW
}
file:webmproducer.go
// GetSendBandwidth calc the sending bandwidth with cycle(s)
func (t *WebMProducer) GetSendBandwidth(cycle int) int {
bw := t.sendByte / cycle / 1000
t.sendByte = 0
return bw
}
fixed
recvBW = c.recvByte / cycle / 1024
bw := t.sendByte / cycle / 1024
What did you expect?
What happened?