Add support for RTP stream restart. (#4161)
* Add support for RTP stream restart. When an unhandled packet is encountered, try a restart sequence. Restart happens when 5 packets with contiguous sequence numbers and same or increasing time stamps are received. Note that this does not work for B-frame type of scenarios, but that is true for receive path handling even before this. As WebRTC does not use B-frames, it is fine. But, needs to be looked at again if B-frames are necessary. It is controlled by a config that is disabled by default. * clean up * debug log
This commit is contained in:
@@ -138,6 +138,12 @@ func (r *RedReceiver) ResyncDownTracks() {
|
||||
})
|
||||
}
|
||||
|
||||
func (r *RedReceiver) OnStreamRestart() {
|
||||
r.downTrackSpreader.Broadcast(func(dt TrackSender) {
|
||||
dt.ReceiverRestart()
|
||||
})
|
||||
}
|
||||
|
||||
func (r *RedReceiver) CanClose() bool {
|
||||
return r.closed.Load() || r.downTrackSpreader.DownTrackCount() == 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user