Skip to content

Commit 49325bb

Browse files
committed
Improvements
1 parent 275c58d commit 49325bb

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

Sources/StreamVideo/Utils/AudioSession/AudioDeviceModule/AudioDeviceModule.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ final class AudioDeviceModule: NSObject, RTCAudioDeviceModuleDelegate, Encodable
188188

189189
// MARK: - Recording
190190

191-
func terminate() {
192-
_ = source.terminate()
191+
func reset() {
192+
_ = source.reset()
193193
}
194194

195195
func setStereoPlayoutPreference(_ isPreferred: Bool) {
@@ -264,7 +264,7 @@ final class AudioDeviceModule: NSObject, RTCAudioDeviceModuleDelegate, Encodable
264264
/// - Parameter isMuted: `true` to mute the microphone, `false` to unmute.
265265
/// - Throws: `ClientError` when the underlying module reports a failure.
266266
func setMuted(_ isMuted: Bool) throws {
267-
guard isMuted != isMicrophoneMuted else {
267+
guard isMuted != source.isMicrophoneMuted else {
268268
return
269269
}
270270

Sources/StreamVideo/Utils/AudioSession/AudioDeviceModule/RTCAudioDeviceModuleControlling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protocol RTCAudioDeviceModuleControlling: AnyObject {
1717
var isManualRestoreVoiceProcessingOnMono: Bool { get }
1818
var prefersStereoPlayout: Bool { get set }
1919

20-
func terminate() -> Int
20+
func reset() -> Int
2121
func initAndStartPlayout() -> Int
2222
func startPlayout() -> Int
2323
func stopPlayout() -> Int

Sources/StreamVideo/Utils/AudioSession/RTCAudioStore/Namespace/Middleware/RTCAudioStore+AudioDeviceModuleMiddleware.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ extension RTCAudioStore {
145145
_ audioDeviceModule: AudioDeviceModule?,
146146
state: RTCAudioStore.StoreState
147147
) throws {
148-
log
149-
.throwing("Unable to disable recording.", subsystems: .audioSession) {
150-
try state.audioDeviceModule?.setRecording(false)
151-
}
152-
state.audioDeviceModule?.terminate()
148+
state.audioDeviceModule?.reset()
153149

154150
disposableBag.removeAll()
155151

Sources/StreamVideo/WebRTC/PeerConnectionFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ final class PeerConnectionFactory: @unchecked Sendable {
6969
_ = factory
7070
_ = audioDeviceModule
7171
// Remove caching
72-
// PeerConnectionFactoryStorage.shared.store(self, for: audioProcessingModule)
72+
PeerConnectionFactoryStorage.shared.store(self, for: audioProcessingModule)
7373
}
7474

7575
deinit {

0 commit comments

Comments
 (0)