Disable fast negotiation temporarily after migration (#2991)
This commit is contained in:
+12
-2
@@ -1009,7 +1009,7 @@ func (t *PCTransport) Negotiate(force bool) {
|
|||||||
// no op to cancel pending negotiation
|
// no op to cancel pending negotiation
|
||||||
})
|
})
|
||||||
t.debouncePending = false
|
t.debouncePending = false
|
||||||
t.lastNegotiate = time.Now()
|
t.updateLastNeogitateLocked()
|
||||||
|
|
||||||
postEvent = true
|
postEvent = true
|
||||||
} else {
|
} else {
|
||||||
@@ -1017,7 +1017,7 @@ func (t *PCTransport) Negotiate(force bool) {
|
|||||||
t.debouncedNegotiate(func() {
|
t.debouncedNegotiate(func() {
|
||||||
t.lock.Lock()
|
t.lock.Lock()
|
||||||
t.debouncePending = false
|
t.debouncePending = false
|
||||||
t.lastNegotiate = time.Now()
|
t.updateLastNeogitateLocked()
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
|
|
||||||
t.postEvent(event{
|
t.postEvent(event{
|
||||||
@@ -1036,6 +1036,12 @@ func (t *PCTransport) Negotiate(force bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *PCTransport) updateLastNeogitateLocked() {
|
||||||
|
if now := time.Now(); now.After(t.lastNegotiate) {
|
||||||
|
t.lastNegotiate = now
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (t *PCTransport) ICERestart() error {
|
func (t *PCTransport) ICERestart() error {
|
||||||
if t.pc.ConnectionState() == webrtc.PeerConnectionStateClosed {
|
if t.pc.ConnectionState() == webrtc.PeerConnectionStateClosed {
|
||||||
t.params.Logger.Warnw("trying to restart ICE on closed peer connection", nil)
|
t.params.Logger.Warnw("trying to restart ICE on closed peer connection", nil)
|
||||||
@@ -1234,6 +1240,10 @@ func (t *PCTransport) SetPreviousSdp(offer, answer *webrtc.SessionDescription) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// disable fast negotiation temporarily after migration to avoid sending offer
|
||||||
|
// contains part of subscribed tracks before migration (needs some time to resolve them).
|
||||||
|
// browser might have trouble to handle this kind of offer (To be confirmed).
|
||||||
|
t.lastNegotiate = time.Now().Add(iceFailedTimeoutTotal)
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user