mirror of
https://github.com/livekit/livekit.git
synced 2026-04-26 23:55:25 +00:00
Rename state for consistency (#325)
This commit is contained in:
@@ -459,7 +459,7 @@ func (p *ParticipantImpl) SetPreviousAnswer(previous *webrtc.SessionDescription)
|
||||
func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) {
|
||||
p.lock.Lock()
|
||||
preState := p.MigrateState()
|
||||
if preState == types.MigrateComplete || preState == s {
|
||||
if preState == types.MigrateStateComplete || preState == s {
|
||||
p.lock.Unlock()
|
||||
return
|
||||
}
|
||||
@@ -468,7 +468,7 @@ func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) {
|
||||
p.migrateState.Store(s)
|
||||
if s == types.MigrateStateSync {
|
||||
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
||||
p.migrateState.Store(types.MigrateComplete)
|
||||
p.migrateState.Store(types.MigrateStateComplete)
|
||||
}
|
||||
pendingOffer = p.pendingOffer
|
||||
p.pendingOffer = nil
|
||||
@@ -821,7 +821,7 @@ func (p *ParticipantImpl) setupLocalParticipant() {
|
||||
|
||||
p.LocalParticipant.OnTrackPublished(func(track types.PublishedTrack) {
|
||||
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
||||
p.SetMigrateState(types.MigrateComplete)
|
||||
p.SetMigrateState(types.MigrateStateComplete)
|
||||
}
|
||||
|
||||
if p.onTrackPublished != nil {
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ func (r *Room) Join(participant types.Participant, opts *ParticipantOptions, ice
|
||||
return err
|
||||
}
|
||||
|
||||
participant.SetMigrateState(types.MigrateComplete)
|
||||
participant.SetMigrateState(types.MigrateStateComplete)
|
||||
|
||||
if participant.SubscriberAsPrimary() {
|
||||
// initiates sub connection as primary
|
||||
|
||||
@@ -29,7 +29,7 @@ type MigrateState int32
|
||||
const (
|
||||
MigrateStateInit MigrateState = iota
|
||||
MigrateStateSync
|
||||
MigrateComplete
|
||||
MigrateStateComplete
|
||||
)
|
||||
|
||||
//counterfeiter:generate . Participant
|
||||
|
||||
Reference in New Issue
Block a user