From 1e0cf89f7a19294a581831a28acabcb6dc289f48 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 5 Jul 2017 11:55:00 -0500 Subject: [PATCH] Explanatory comment // FREEBIE --- Signal/src/call/CallAudioService.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Signal/src/call/CallAudioService.swift b/Signal/src/call/CallAudioService.swift index 33f739e0e..03ea9d08f 100644 --- a/Signal/src/call/CallAudioService.swift +++ b/Signal/src/call/CallAudioService.swift @@ -258,6 +258,9 @@ import AVFoundation } Logger.info("\(self.TAG) playing sound: \(sound.filePath)") + // It's important to stop the current player **before** starting the new player. In the case that + // we're playing the same sound, since the player is memoized on the sound instance, we'd otherwise + // stop the sound we just started. self.currentPlayer?.stop() newPlayer.play() self.currentPlayer = newPlayer