srctree

Robin Linden parent 54312ba5 c785a386
Release audio players after using them

inlinesplit
atox/src/main/kotlin/tox/EventListenerCallbacks.kt added: 5, removed: 2, total 3
@@ -173,6 +173,7 @@ class EventListenerCallbacks @Inject constructor(
Log.e(TAG, "callState ${pk.take(8)} $callState")
if (callState.contains(ToxavFriendCallState.FINISHED) || callState.contains(ToxavFriendCallState.ERROR)) {
audioPlayer?.stop()
audioPlayer?.release()
audioPlayer = null
notificationHelper.dismissCallNotification(contactByPublicKey(pk))
callManager.endCall(PublicKey(pk))
 
domain/src/main/kotlin/av/AudioPlayer.kt added: 5, removed: 2, total 3
@@ -48,4 +48,6 @@ class AudioPlayer(sampleRate: Int, channels: Int) {
audioTrack.pause()
audioTrack.flush()
}
 
fun release() = audioTrack.release()
}