Skip to content

Commit e452b55

Browse files
committed
VideoHardMuteActor の start 時に capturer を明示的に保持するように修正
1 parent 92897f3 commit e452b55

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sora/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public struct Configuration {
139139
///
140140
/// `cameraSettings.isEnabled` が `true` の場合でも、このフラグが `false` であれば
141141
/// 接続時点ではカメラキャプチャを起動しません。
142-
/// 後から `MediaChannel.setVideoHardMute(false)` などで必要に応じて開始できます
142+
/// 後から `MediaChannel.setVideoHardMute(false)` で必要に応じて開始できます
143143
public var initialCameraEnabled: Bool = true
144144

145145
/// サイマルキャストの可否。 `true` であればサイマルキャストを有効にします。

Sora/VideoMute.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ actor VideoHardMuteActor {
141141
// CameraVideoCapturer.start はコールバック形式です
142142
let capturer = CameraVideoCapturer(device: device)
143143
capturer.stream = senderStream
144-
capturer.start(format: format, frameRate: frameRate) { error in
144+
// start 完了まで capturer を確実に生存させるためにクロージャ側でも保持します。
145+
// start 成功時は CameraVideoCapturer.current がセットされ、以後はそちらが保持します。
146+
capturer.start(format: format, frameRate: frameRate) { [capturer] error in
145147
if let error {
146148
continuation.resume(throwing: error)
147149
} else {

0 commit comments

Comments
 (0)