Sample RTP write error logs. (#927)

* Sample RTP write error logs.

When a client goes away without notice, the media connection
will be severed. Writes will fail till connection is closed.
Avoid log spam in those scenarios. Just log one in 100 failures.

* Change reminder so that first failures gets logged

* log failure count
This commit is contained in:
Raja Subramanian
2022-08-17 13:38:08 +05:30
committed by GitHub
parent f5627c3859
commit df78179bbb
2 changed files with 38 additions and 31 deletions
+1 -3
View File
@@ -563,9 +563,7 @@ func (w *WebRTCReceiver) forwardRTP(layer int32) {
}
w.downTrackSpreader.Broadcast(func(dt TrackSender) {
if err := dt.WriteRTP(pkt, spatialLayer); err != nil {
w.logger.Errorw("failed writing to down track", err)
}
_ = dt.WriteRTP(pkt, spatialLayer)
})
}
}