From 7f6c2ba3313c0ac58e2e33bf4f6be0141879442e Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 24 Jul 2025 12:28:39 +0200 Subject: [PATCH] Try to fix video issue when starting video call and video is declined when answered by remote end --- .../linphone/ui/call/viewmodel/CurrentCallViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index e9e518902..bb85ed2a9 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -359,7 +359,7 @@ class CurrentCallViewModel } } isVideoEnabled.postValue(videoEnabled) - updateVideoDirection(call.currentParams.videoDirection) + updateVideoDirection(call.currentParams.videoDirection, skipIfNotStreamsRunning = true) if (call.state == Call.State.Connected) { updateCallDuration() @@ -1161,7 +1161,7 @@ class CurrentCallViewModel ) } else { isVideoEnabled.postValue(call.currentParams.isVideoEnabled) - updateVideoDirection(call.currentParams.videoDirection) + updateVideoDirection(call.currentParams.videoDirection, skipIfNotStreamsRunning = true) } if (ActivityCompat.checkSelfPermission( @@ -1286,9 +1286,9 @@ class CurrentCallViewModel } @WorkerThread - private fun updateVideoDirection(direction: MediaDirection) { + private fun updateVideoDirection(direction: MediaDirection, skipIfNotStreamsRunning: Boolean = false) { val state = currentCall.state - if (state != Call.State.StreamsRunning) { + if (skipIfNotStreamsRunning && state != Call.State.StreamsRunning) { return }