From e32f911ab935a76c61a7f86a4d817dc632cd7202 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 21 May 2020 12:29:41 +0200 Subject: [PATCH] Don't account failed writes in rate estimator. --- client.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 400bcce..deb6473 100644 --- a/client.go +++ b/client.go @@ -463,8 +463,11 @@ func writeLoop(conn *upConnection, track *upTrack, ch <-chan packetIndex) { for _, l := range local { err := l.track.WriteRTP(&packet) - if err != nil && err != io.ErrClosedPipe { - log.Printf("%v", err) + if err != nil { + if err != io.ErrClosedPipe { + log.Printf("WriteRTP: %v", err) + } + continue } l.rate.Add(uint32(bytes)) } @@ -917,7 +920,7 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *downTrack) { } err = track.track.WriteRTP(&packet) if err != nil { - log.Printf("%v", err) + log.Printf("WriteRTP: %v", err) continue } track.rate.Add(uint32(l))