mirror of
https://github.com/livekit/livekit.git
synced 2026-08-29 05:29:32 +00:00
Send left over RTCP packets. (#1699)
This commit is contained in:
+15
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ func (r *RTPStats) ToString() string {
|
||||
|
||||
str := fmt.Sprintf("t: %+v|%+v|%.2fs", p.StartTime.AsTime().Format(time.UnixDate), p.EndTime.AsTime().Format(time.UnixDate), p.Duration)
|
||||
|
||||
str += fmt.Sprintf(" sn: %d|%d", r.extStartSN, r.getExtHighestSN())
|
||||
str += fmt.Sprintf(", sn: %d|%d", r.extStartSN, r.getExtHighestSN())
|
||||
str += fmt.Sprintf(", ep: %d|%.2f/s", expectedPackets, expectedPacketRate)
|
||||
|
||||
str += fmt.Sprintf(", p: %d|%.2f/s", p.Packets, p.PacketRate)
|
||||
|
||||
Reference in New Issue
Block a user