From 206ee43baa57ddcdb4b306622d2e20be1fb1902b Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 29 Aug 2024 17:48:27 +0200 Subject: [PATCH] Avoid to ask duration/quality from a not running call. --- Linphone/model/call/CallModel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp index b8c7b5fad..822619f38 100644 --- a/Linphone/model/call/CallModel.cpp +++ b/Linphone/model/call/CallModel.cpp @@ -36,7 +36,6 @@ CallModel::CallModel(const std::shared_ptr &call, QObject *paren mDurationTimer.setSingleShot(false); connect(&mDurationTimer, &QTimer::timeout, this, [this]() { this->durationChanged(mMonitor->getDuration()); }); connect(&mDurationTimer, &QTimer::timeout, this, [this]() { this->qualityUpdated(mMonitor->getCurrentQuality()); }); - mDurationTimer.start(); mMicroVolumeTimer.setInterval(50); mMicroVolumeTimer.setSingleShot(false); @@ -422,6 +421,7 @@ void CallModel::onStateChanged(const std::shared_ptr &call, const std::string &message) { lDebug() << "CallModel::onStateChanged" << (int)state; if (state == linphone::Call::State::StreamsRunning) { + mDurationTimer.start(); // After UpdatedByRemote, video direction could be changed. auto params = call->getRemoteParams(); auto videoDirection = params ? params->getVideoDirection() : linphone::MediaDirection::Inactive; @@ -432,6 +432,8 @@ void CallModel::onStateChanged(const std::shared_ptr &call, videoDirection == linphone::MediaDirection::SendRecv); setConference(call->getConference()); updateConferenceVideoLayout(); + } else if (state == linphone::Call::State::End) { + mDurationTimer.stop(); } emit stateChanged(call, state, message); }