mirror of
https://github.com/livekit/livekit.git
synced 2026-05-24 23:26:11 +00:00
shorten the time cost for subscriber get media tracks (#747)
* set DownTrack's initial codec to first codec of potential codecs * faststart on subscribe
This commit is contained in:
@@ -312,9 +312,9 @@ func (b *Buffer) SetPLIThrottle(duration int64) {
|
||||
b.pliThrottle = duration
|
||||
}
|
||||
|
||||
func (b *Buffer) SendPLI() {
|
||||
func (b *Buffer) SendPLI(force bool) {
|
||||
b.RLock()
|
||||
if b.rtpStats == nil || b.rtpStats.TimeSinceLastPli() < b.pliThrottle {
|
||||
if (b.rtpStats == nil || b.rtpStats.TimeSinceLastPli() < b.pliThrottle) && !force {
|
||||
b.RUnlock()
|
||||
return
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func (b *Buffer) SendPLI() {
|
||||
b.rtpStats.UpdatePliAndTime(1)
|
||||
b.RUnlock()
|
||||
|
||||
b.logger.Debugw("send pli", "ssrc", b.mediaSSRC)
|
||||
b.logger.Debugw("send pli", "ssrc", b.mediaSSRC, "force", force)
|
||||
pli := []rtcp.Packet{
|
||||
&rtcp.PictureLossIndication{SenderSSRC: rand.Uint32(), MediaSSRC: b.mediaSSRC},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user