mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 11:44:43 +00:00
Fix deadlock in regress codec check. (#4775)
This commit is contained in:
@@ -348,8 +348,11 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track sfu.TrackRe
|
||||
})
|
||||
|
||||
ti := t.MediaTrackReceiver.TrackInfoClone()
|
||||
t.lock.Lock()
|
||||
|
||||
var regressCodec bool
|
||||
enableRegression := t.enableRegression()
|
||||
|
||||
t.lock.Lock()
|
||||
mimeType := mime.NormalizeMimeType(track.Codec().MimeType)
|
||||
layer := buffer.GetSpatialLayerForRid(mimeType, track.RID(), ti)
|
||||
if layer < 0 {
|
||||
@@ -531,7 +534,7 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track sfu.TrackRe
|
||||
})
|
||||
}
|
||||
|
||||
if newCodec && t.enableRegression() {
|
||||
if newCodec && enableRegression {
|
||||
if mimeType == t.regressionTargetCodec {
|
||||
t.params.Logger.Infow("regression target codec received", "codec", mimeType)
|
||||
t.regressionTargetCodecReceived = true
|
||||
|
||||
@@ -381,7 +381,7 @@ func (s *RTCService) serve(w http.ResponseWriter, r *http.Request, needsJoinRequ
|
||||
var cr connectionResult
|
||||
var initialResponse *livekit.SignalResponse
|
||||
for attempt := 0; attempt < s.config.SignalRelay.ConnectAttempts; attempt++ {
|
||||
connectionTimeout := 3 * time.Second * time.Duration(attempt+1)
|
||||
connectionTimeout := time.Duration(3+attempt) * time.Second
|
||||
ctx := utils.ContextWithAttempt(r.Context(), attempt)
|
||||
cr, initialResponse, err = s.startConnection(ctx, roomName, pi, connectionTimeout)
|
||||
if err == nil || errors.Is(err, context.Canceled) {
|
||||
|
||||
Reference in New Issue
Block a user