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) {
|
func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
preState := p.MigrateState()
|
preState := p.MigrateState()
|
||||||
if preState == types.MigrateComplete || preState == s {
|
if preState == types.MigrateStateComplete || preState == s {
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -468,7 +468,7 @@ func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) {
|
|||||||
p.migrateState.Store(s)
|
p.migrateState.Store(s)
|
||||||
if s == types.MigrateStateSync {
|
if s == types.MigrateStateSync {
|
||||||
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
||||||
p.migrateState.Store(types.MigrateComplete)
|
p.migrateState.Store(types.MigrateStateComplete)
|
||||||
}
|
}
|
||||||
pendingOffer = p.pendingOffer
|
pendingOffer = p.pendingOffer
|
||||||
p.pendingOffer = nil
|
p.pendingOffer = nil
|
||||||
@@ -821,7 +821,7 @@ func (p *ParticipantImpl) setupLocalParticipant() {
|
|||||||
|
|
||||||
p.LocalParticipant.OnTrackPublished(func(track types.PublishedTrack) {
|
p.LocalParticipant.OnTrackPublished(func(track types.PublishedTrack) {
|
||||||
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
if !p.LocalParticipant.HasPendingMigratedTrack() {
|
||||||
p.SetMigrateState(types.MigrateComplete)
|
p.SetMigrateState(types.MigrateStateComplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.onTrackPublished != nil {
|
if p.onTrackPublished != nil {
|
||||||
|
|||||||
+1
-1
@@ -250,7 +250,7 @@ func (r *Room) Join(participant types.Participant, opts *ParticipantOptions, ice
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
participant.SetMigrateState(types.MigrateComplete)
|
participant.SetMigrateState(types.MigrateStateComplete)
|
||||||
|
|
||||||
if participant.SubscriberAsPrimary() {
|
if participant.SubscriberAsPrimary() {
|
||||||
// initiates sub connection as primary
|
// initiates sub connection as primary
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ type MigrateState int32
|
|||||||
const (
|
const (
|
||||||
MigrateStateInit MigrateState = iota
|
MigrateStateInit MigrateState = iota
|
||||||
MigrateStateSync
|
MigrateStateSync
|
||||||
MigrateComplete
|
MigrateStateComplete
|
||||||
)
|
)
|
||||||
|
|
||||||
//counterfeiter:generate . Participant
|
//counterfeiter:generate . Participant
|
||||||
|
|||||||
Reference in New Issue
Block a user