Send left over RTCP packets. (#1699)

This commit is contained in:
Raja Subramanian
2023-05-09 18:46:30 +05:30
committed by GitHub
parent cf2a078579
commit f543e3f8d0
2 changed files with 16 additions and 2 deletions
+15 -1
View File
@@ -1347,7 +1347,9 @@ func (p *ParticipantImpl) subscriberRTCPWorker() {
sd = append(sd, chunks...)
batchSize = batchSize + 1 + len(chunks)
if batchSize >= sdBatchSize {
pkts = append(pkts, &rtcp.SourceDescription{Chunks: sd})
if len(sd) != 0 {
pkts = append(pkts, &rtcp.SourceDescription{Chunks: sd})
}
if err := p.TransportManager.WriteSubscriberRTCP(pkts); err != nil {
if err == io.EOF || err == io.ErrClosedPipe {
return
@@ -1361,6 +1363,18 @@ func (p *ParticipantImpl) subscriberRTCPWorker() {
}
}
if len(pkts) != 0 || len(sd) != 0 {
if len(sd) != 0 {
pkts = append(pkts, &rtcp.SourceDescription{Chunks: sd})
}
if err := p.TransportManager.WriteSubscriberRTCP(pkts); err != nil {
if err == io.EOF || err == io.ErrClosedPipe {
return
}
p.params.Logger.Errorw("could not send down track reports", err)
}
}
time.Sleep(3 * time.Second)
}
}