Return write count from WriteRTP. (#4059)

* Log write count atomic.

* Return write count from WriteRTP.

Apologies for the frequent changes on this. With relays, the down track
could write to several targets. So, use count to have an accurate
indication of how may subscribers were written to.
This commit is contained in:
Raja Subramanian
2025-11-06 13:29:21 +05:30
committed by GitHub
parent d0ba46b460
commit 4872f2051d
5 changed files with 13 additions and 23 deletions
+1 -3
View File
@@ -820,9 +820,7 @@ func (w *WebRTCReceiver) forwardRTP(layer int32, buff *buffer.Buffer) {
var writeCount atomic.Int32
w.downTrackSpreader.Broadcast(func(dt TrackSender) {
if dt.WriteRTP(pkt, spatialLayer) {
writeCount.Inc()
}
writeCount.Add(dt.WriteRTP(pkt, spatialLayer))
})
if rt := w.redTransformer.Load(); rt != nil {