mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Prevent race condition crash with VuMeter when call is ending
This commit is contained in:
parent
42fbbc51fd
commit
fd3f746e3d
1 changed files with 6 additions and 2 deletions
|
|
@ -1260,8 +1260,12 @@ class CurrentCallViewModel
|
|||
if (corePreferences.showMicrophoneAndSpeakerVuMeters) {
|
||||
volumeVuMeterTickerFlow().onEach {
|
||||
coreContext.postOnCoreThread {
|
||||
microphoneRecordingVolume.postValue(computeVuMeterValue(currentCall.recordVolume))
|
||||
playbackVolume.postValue(computeVuMeterValue(currentCall.playVolume))
|
||||
val call = currentCall
|
||||
val state = call.state
|
||||
if (state == Call.State.End || state == Call.State.Released) return@postOnCoreThread
|
||||
|
||||
microphoneRecordingVolume.postValue(computeVuMeterValue(call.recordVolume))
|
||||
playbackVolume.postValue(computeVuMeterValue(call.playVolume))
|
||||
}
|
||||
}.launchIn(viewModelScope)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue