don't hide trickle decode errors
This commit is contained in:
@@ -241,7 +241,10 @@ func (c *RTCClient) Run() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case *livekit.SignalResponse_Trickle:
|
case *livekit.SignalResponse_Trickle:
|
||||||
candidateInit := rtc.FromProtoTrickle(msg.Trickle)
|
candidateInit, err := rtc.FromProtoTrickle(msg.Trickle)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if msg.Trickle.Target == livekit.SignalTarget_PUBLISHER {
|
if msg.Trickle.Target == livekit.SignalTarget_PUBLISHER {
|
||||||
err = c.publisher.AddICECandidate(candidateInit)
|
err = c.publisher.AddICECandidate(candidateInit)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+6
-3
@@ -84,10 +84,13 @@ func ToProtoTrickle(candidateInit webrtc.ICECandidateInit) *livekit.TrickleReque
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func FromProtoTrickle(trickle *livekit.TrickleRequest) webrtc.ICECandidateInit {
|
func FromProtoTrickle(trickle *livekit.TrickleRequest) (webrtc.ICECandidateInit, error) {
|
||||||
ci := webrtc.ICECandidateInit{}
|
ci := webrtc.ICECandidateInit{}
|
||||||
json.Unmarshal([]byte(trickle.CandidateInit), &ci)
|
err := json.Unmarshal([]byte(trickle.CandidateInit), &ci)
|
||||||
return ci
|
if err != nil {
|
||||||
|
return webrtc.ICECandidateInit{}, err
|
||||||
|
}
|
||||||
|
return ci, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ToProtoTrack(t types.PublishedTrack) *livekit.TrackInfo {
|
func ToProtoTrack(t types.PublishedTrack) *livekit.TrackInfo {
|
||||||
|
|||||||
@@ -332,7 +332,11 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici
|
|||||||
logger.Errorw("could not handle answer", "participant", participant.Identity(), "err", err)
|
logger.Errorw("could not handle answer", "participant", participant.Identity(), "err", err)
|
||||||
}
|
}
|
||||||
case *livekit.SignalRequest_Trickle:
|
case *livekit.SignalRequest_Trickle:
|
||||||
candidateInit := rtc.FromProtoTrickle(msg.Trickle)
|
candidateInit, err := rtc.FromProtoTrickle(msg.Trickle)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorw("could not decode trickle", "participant", participant.Identity(), "err", err)
|
||||||
|
break
|
||||||
|
}
|
||||||
//logger.Debugw("adding peer candidate", "participant", participant.ID())
|
//logger.Debugw("adding peer candidate", "participant", participant.ID())
|
||||||
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {
|
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {
|
||||||
logger.Errorw("could not handle trickle", "participant", participant.Identity(), "err", err)
|
logger.Errorw("could not handle trickle", "participant", participant.Identity(), "err", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user