Skip to content

Commit 55ac2f6

Browse files
committed
Increase debounce time on StereoPlayout availability
1 parent d6cbff1 commit 55ac2f6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ final class AudioDeviceModule: NSObject, RTCAudioDeviceModuleDelegate, Encodable
169169
.eraseToAnyPublisher()
170170
super.init()
171171

172+
subject
173+
.log(.debug, subsystems: .audioSession) { "\($0)" }
174+
.sink { _ in }
175+
.store(in: disposableBag)
176+
172177
audioLevelsAdapter.subject = audioLevelSubject
173178
source.observer = self
174179

Sources/StreamVideo/Utils/AudioSession/RTCAudioStore/Namespace/Effects/RTCAudioStore+StereoPlayoutEffect.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ extension RTCAudioStore {
5555
.removeDuplicates()
5656
)
5757
.map { $0 && $1 }
58+
.debounce(for: .seconds(1), scheduler: processingQueue)
5859
.receive(on: processingQueue)
5960
.sink { [weak self, weak audioDeviceModule] isPlayoutAvailable in
6061
self?.dispatcher?.dispatch(.stereo(.setPlayoutAvailable(isPlayoutAvailable)))
61-
log.throwing("Unable to setStereoPlayout:\(isPlayoutAvailable)", subsystems: .audioSession) {
62+
log.throwing(subsystems: .audioSession) {
6263
try audioDeviceModule?.setStereoPlayoutEnabled(isPlayoutAvailable)
6364
}
6465
}

Sources/StreamVideo/Utils/Logger/Logger+ThrowingExecution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
extension Logger {
88

99
func throwing(
10-
_ message: @autoclosure () -> String,
10+
_ message: @autoclosure () -> String = "",
1111
subsystems: LogSubsystem,
1212
file: StaticString = #file,
1313
function: StaticString = #function,

0 commit comments

Comments
 (0)