diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-12-04 15:39:36 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:35 -0800 |
commit | b98d6020698c44b55658873aa21199f938cc1b8e (patch) | |
tree | a2945a8ed6fd3272c50212f65e439fd79e8ea3e9 | |
parent | dd250273f476a96e60e7953915d76f6e2dd765ec (diff) |
Voice was not renegotiating when re-enabled.
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index ddd757c39f..a8285f9aab 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -357,6 +357,8 @@ void LLWebRTCVoiceClient::cleanUp() { LL_DEBUGS("Voice") << LL_ENDL; + mNextAudioSession.reset(); + mAudioSession.reset(); sessionState::deleteAllSessions(); LL_DEBUGS("Voice") << "exiting" << LL_ENDL; } @@ -470,16 +472,19 @@ void LLWebRTCVoiceClient::voiceConnectionCoro() { while (!sShuttingDown) { + llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); + if (!mVoiceEnabled) + { + continue; + } // add session for region or parcel voice. LLViewerRegion *regionp = gAgent.getRegion(); if (!regionp) { - llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); continue; } if (regionp->getRegionID().isNull()) { - llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); continue; } if (!mAudioSession || mAudioSession->mIsSpatial) @@ -503,7 +508,6 @@ void LLWebRTCVoiceClient::voiceConnectionCoro() sessionState::for_each(boost::bind(predProcessSessionStates, _1)); sendPositionAndVolumeUpdate(true); updateOwnVolume(); - llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); } } catch (const LLCoros::Stop&) @@ -1801,6 +1805,7 @@ void LLWebRTCVoiceClient::setVoiceEnabled(bool enabled) LLVoiceChannel::getCurrentVoiceChannel()->deactivate(); gAgent.setVoiceConnected(false); status = LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED; + cleanUp(); } notifyStatusObservers(status); @@ -2261,6 +2266,7 @@ void LLWebRTCVoiceClient::deleteSession(const sessionStatePtr_t &session) void LLWebRTCVoiceClient::sessionState::deleteAllSessions() { mSessions.clear(); + } void LLWebRTCVoiceClient::verifySessionState(void) |