Skip to content

Commit

Permalink
Fix FrameCryptor deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Jun 25, 2024
1 parent bf2129a commit 367d95f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Sources/LiveKit/E2EE/E2EEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,12 @@ public class E2EEManager: NSObject, ObservableObject, Loggable {
return
}

guard let frameCryptor = DispatchQueue.liveKitWebRTC.sync(execute: {
LKRTCFrameCryptor(factory: RTC.peerConnectionFactory,
rtpSender: sender,
participantId: participantIdentity.stringValue,
algorithm: .aesGcm,
keyProvider: e2eeOptions.keyProvider.rtcKeyProvider)
}) else {
guard let frameCryptor = LKRTCFrameCryptor(factory: RTC.peerConnectionFactory,
rtpSender: sender,
participantId: participantIdentity.stringValue,
algorithm: .aesGcm,
keyProvider: e2eeOptions.keyProvider.rtcKeyProvider)
else {
log("frameCryptor is nil, skipping creating frame cryptor...", .warning)
return
}
Expand All @@ -144,13 +143,12 @@ public class E2EEManager: NSObject, ObservableObject, Loggable {
return
}

guard let frameCryptor = DispatchQueue.liveKitWebRTC.sync(execute: {
LKRTCFrameCryptor(factory: RTC.peerConnectionFactory,
rtpReceiver: receiver,
participantId: participantIdentity.stringValue,
algorithm: .aesGcm,
keyProvider: e2eeOptions.keyProvider.rtcKeyProvider)
}) else {
guard let frameCryptor = LKRTCFrameCryptor(factory: RTC.peerConnectionFactory,
rtpReceiver: receiver,
participantId: participantIdentity.stringValue,
algorithm: .aesGcm,
keyProvider: e2eeOptions.keyProvider.rtcKeyProvider)
else {
log("frameCryptor is nil, skipping creating frame cryptor...", .warning)
return
}
Expand Down

0 comments on commit 367d95f

Please sign in to comment.