File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -203,9 +203,10 @@ public class AudioManager: Loggable {
203203 // trigger events when state mutates
204204 _state. onDidMutate = { [ weak self] newState, oldState in
205205 guard let self else { return }
206+ // Return if state is equal.
207+ guard newState != oldState else { return }
206208
207209 self . log ( " \( oldState) -> \( newState) " )
208-
209210 #if os(iOS)
210211 let configureFunc = newState. customConfigureFunc ?? self . defaultConfigureAudioSessionFunc
211212 configureFunc ( newState, oldState)
Original file line number Diff line number Diff line change @@ -351,16 +351,16 @@ extension Track {
351351 func _mute( ) async throws {
352352 // LocalTrack only, already muted
353353 guard self is LocalTrack , !isMuted else { return }
354- try await disable ( )
355- try await stop ( )
354+ try await disable ( ) // Disable track first
355+ try await stop ( ) // Stop track
356356 set ( muted: true , shouldSendSignal: true )
357357 }
358358
359359 func _unmute( ) async throws {
360360 // LocalTrack only, already un-muted
361361 guard self is LocalTrack , isMuted else { return }
362- try await enable ( )
363- try await start ( )
362+ try await start ( ) // Start track first (Configure session first if local audio )
363+ try await enable ( ) // Enable track
364364 set ( muted: false , shouldSendSignal: true )
365365 }
366366}
You can’t perform that action at this time.
0 commit comments