Prevent invalid track access while peer connection is shutting down. (#4054)
This commit is contained in:
@@ -503,6 +503,7 @@ func (r *Room) Join(
|
|||||||
fields := append(
|
fields := append(
|
||||||
connectionDetailsFields(infos),
|
connectionDetailsFields(infos),
|
||||||
"clientInfo", logger.Proto(sutils.ClientInfoWithoutAddress(p.GetClientInfo())),
|
"clientInfo", logger.Proto(sutils.ClientInfoWithoutAddress(p.GetClientInfo())),
|
||||||
|
"connectTime", connectTime,
|
||||||
)
|
)
|
||||||
p.GetLogger().Infow("participant active", fields...)
|
p.GetLogger().Infow("participant active", fields...)
|
||||||
} else if state == livekit.ParticipantInfo_DISCONNECTED {
|
} else if state == livekit.ParticipantInfo_DISCONNECTED {
|
||||||
|
|||||||
@@ -2905,8 +2905,12 @@ func (t *PCTransport) getMidToTrackIDMapping() map[string]string {
|
|||||||
transceivers := t.pc.GetTransceivers()
|
transceivers := t.pc.GetTransceivers()
|
||||||
midToTrackID := make(map[string]string, len(transceivers))
|
midToTrackID := make(map[string]string, len(transceivers))
|
||||||
for _, tr := range transceivers {
|
for _, tr := range transceivers {
|
||||||
if tr.Sender() != nil && tr.Sender().Track() != nil && tr.Mid() != "" {
|
if mid := tr.Mid(); mid != "" {
|
||||||
midToTrackID[tr.Mid()] = tr.Sender().Track().ID()
|
if sender := tr.Sender(); sender != nil {
|
||||||
|
if track := sender.Track(); track != nil {
|
||||||
|
midToTrackID[mid] = track.ID()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return midToTrackID
|
return midToTrackID
|
||||||
|
|||||||
Reference in New Issue
Block a user