mirror of
https://github.com/livekit/livekit.git
synced 2026-06-01 09:14:32 +00:00
don't hide trickle decode errors
This commit is contained in:
@@ -241,7 +241,10 @@ func (c *RTCClient) Run() error {
|
||||
return err
|
||||
}
|
||||
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 {
|
||||
err = c.publisher.AddICECandidate(candidateInit)
|
||||
} 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{}
|
||||
json.Unmarshal([]byte(trickle.CandidateInit), &ci)
|
||||
return ci
|
||||
err := json.Unmarshal([]byte(trickle.CandidateInit), &ci)
|
||||
if err != nil {
|
||||
return webrtc.ICECandidateInit{}, err
|
||||
}
|
||||
return ci, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
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())
|
||||
if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil {
|
||||
logger.Errorw("could not handle trickle", "participant", participant.Identity(), "err", err)
|
||||
|
||||
Reference in New Issue
Block a user