use IsReady instead of checking for multiple statuses

This commit is contained in:
David Zhao
2021-01-10 22:09:36 -08:00
parent 7dcb88343a
commit 456df0fb91
7 changed files with 130 additions and 22 deletions
+3 -5
View File
@@ -262,14 +262,12 @@ func (t *MediaTrack) forwardRTPWorker() {
if delta < maxPLIFrequency {
continue
}
logger.GetLogger().Infow("keyframe required, sending PLI")
logger.GetLogger().Infow("keyframe required, sending PLI",
"srcParticipant", t.participantId)
rtcpPkts := []rtcp.Packet{
&rtcp.PictureLossIndication{SenderSSRC: uint32(t.ssrc), MediaSSRC: pkt.SSRC},
}
// queue up a PLI, but don't block channel
go func() {
t.rtcpCh <- rtcpPkts
}()
t.rtcpCh <- rtcpPkts
t.lastPLI = time.Now()
} else if err != nil {
logger.GetLogger().Warnw("could not forward packet to participant",