mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 09:24:08 +00:00
fixes
This commit is contained in:
@@ -1327,7 +1327,6 @@ func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest) {
|
||||
|
||||
p.sendTrackPublished(req.Cid, ti)
|
||||
|
||||
// SINGLE-PEER-CONNECTION-TODO: is this needed?
|
||||
p.handlePendingRemoteTracks()
|
||||
}
|
||||
|
||||
|
||||
+14
-4
@@ -1009,12 +1009,22 @@ func (t *PCTransport) RemoveTrack(sender *webrtc.RTPSender) error {
|
||||
return t.pc.RemoveTrack(sender)
|
||||
}
|
||||
|
||||
func (t *PCTransport) CurrentLocalDescription() *webrtc.SessionDescription {
|
||||
return t.pc.CurrentLocalDescription()
|
||||
func (t *PCTransport) CurrentLocalDescription() webrtc.SessionDescription {
|
||||
cld := t.pc.CurrentLocalDescription()
|
||||
if cld == nil {
|
||||
return webrtc.SessionDescription{}
|
||||
}
|
||||
|
||||
return *cld
|
||||
}
|
||||
|
||||
func (t *PCTransport) CurrentRemoteDescription() *webrtc.SessionDescription {
|
||||
return t.pc.CurrentRemoteDescription()
|
||||
func (t *PCTransport) CurrentRemoteDescription() webrtc.SessionDescription {
|
||||
crd := t.pc.CurrentRemoteDescription()
|
||||
if crd == nil {
|
||||
return webrtc.SessionDescription{}
|
||||
}
|
||||
|
||||
return *crd
|
||||
}
|
||||
|
||||
func (t *PCTransport) GetMid(rtpReceiver *webrtc.RTPReceiver) string {
|
||||
|
||||
+14
-16
@@ -411,27 +411,25 @@ func (t *TransportManager) createDataChannelsForSubscriber(pendingDataChannels [
|
||||
|
||||
func (t *TransportManager) GetUnmatchMediaForOffer(parsedOffer *sdp.SessionDescription, mediaType string) (unmatched []*sdp.MediaDescription, err error) {
|
||||
var lastMatchedMid string
|
||||
var lastAnswer *webrtc.SessionDescription
|
||||
var lastAnswer webrtc.SessionDescription
|
||||
if t.params.SinglePeerConnection {
|
||||
lastAnswer = t.subscriber.CurrentLocalDescription()
|
||||
} else {
|
||||
lastAnswer = t.publisher.CurrentLocalDescription()
|
||||
}
|
||||
if lastAnswer != nil {
|
||||
t.params.Logger.Infow("RAJA lastAnswer", "lastAnswer", lastAnswer) // REMOVE
|
||||
parsedAnswer, err1 := lastAnswer.Unmarshal()
|
||||
if err1 != nil {
|
||||
// should not happen
|
||||
t.params.Logger.Errorw("failed to parse last answer", err1)
|
||||
return unmatched, err1
|
||||
}
|
||||
|
||||
for i := len(parsedAnswer.MediaDescriptions) - 1; i >= 0; i-- {
|
||||
media := parsedAnswer.MediaDescriptions[i]
|
||||
if media.MediaName.Media == mediaType {
|
||||
lastMatchedMid, _ = media.Attribute(sdp.AttrKeyMID)
|
||||
break
|
||||
}
|
||||
parsedAnswer, err1 := lastAnswer.Unmarshal()
|
||||
if err1 != nil {
|
||||
// should not happen
|
||||
t.params.Logger.Errorw("failed to parse last answer", err1)
|
||||
return unmatched, err1
|
||||
}
|
||||
|
||||
for i := len(parsedAnswer.MediaDescriptions) - 1; i >= 0; i-- {
|
||||
media := parsedAnswer.MediaDescriptions[i]
|
||||
if media.MediaName.Media == mediaType {
|
||||
lastMatchedMid, _ = media.Attribute(sdp.AttrKeyMID)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +447,7 @@ func (t *TransportManager) GetUnmatchMediaForOffer(parsedOffer *sdp.SessionDescr
|
||||
return
|
||||
}
|
||||
|
||||
func (t *TransportManager) LastPublisherOffer() *webrtc.SessionDescription {
|
||||
func (t *TransportManager) LastPublisherOffer() webrtc.SessionDescription {
|
||||
/* RAJA-REMOVE
|
||||
if sd := t.lastPublisherOffer.Load(); sd != nil {
|
||||
return sd.(webrtc.SessionDescription)
|
||||
|
||||
Reference in New Issue
Block a user