mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Improve error handling in sendPLI.
This commit is contained in:
parent
519cb2dbc6
commit
49195ef990
1 changed files with 5 additions and 2 deletions
|
@ -886,14 +886,17 @@ func updateUpBitrate(up *upConnection, maxVideoRate uint64) {
|
|||
}
|
||||
}
|
||||
|
||||
var ErrUnsupportedFeedback = errors.New("unsupported feedback type")
|
||||
var ErrRateLimited = errors.New("rate limited")
|
||||
|
||||
func (up *upConnection) sendPLI(track *upTrack) error {
|
||||
if !track.hasRtcpFb("nack", "pli") {
|
||||
return nil
|
||||
return ErrUnsupportedFeedback
|
||||
}
|
||||
last := atomic.LoadUint64(&track.lastPLI)
|
||||
now := mono.Microseconds()
|
||||
if now >= last && now-last < 200000 {
|
||||
return nil
|
||||
return ErrRateLimited
|
||||
}
|
||||
atomic.StoreUint64(&track.lastPLI, now)
|
||||
return sendPLI(up.pc, track.track.SSRC())
|
||||
|
|
Loading…
Reference in a new issue