summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2017-05-02 14:32:34 -0400
committerOz Linden <oz@lindenlab.com>2017-05-02 14:32:34 -0400
commitd47f604e63b8510cc997f78a03241c95726c750a (patch)
treec8339264608f989208a7491d5e876ef8d9cf126c /indra/newview/llvoicevivox.cpp
parent1b032c37833be3a03170a28b1955c55061936442 (diff)
VOICE-47: Disconnect from voice during teleport to prevent audio artifacts
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index b13f9a22aa..a7658fe0be 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1637,8 +1637,9 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
notifyStatusObservers(LLVoiceClientStatusObserver::ERROR_UNKNOWN);
if (mSessionTerminateRequested)
+ {
terminateAudioSession(true);
-
+ }
// if a relog has been requested then addAndJoineSession
// failed in a spectacular way and we need to back out.
// If this is not the case then we were simply trying to
@@ -2645,9 +2646,16 @@ static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVe
void LLVivoxVoiceClient::setHidden(bool hidden)
{
mHidden = hidden;
-
- sendPositionAndVolumeUpdate();
- return;
+
+ if (mHidden && inSpatialChannel())
+ {
+ // get out of the channel entirely
+ leaveAudioSession();
+ }
+ else
+ {
+ sendPositionAndVolumeUpdate();
+ }
}
void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
@@ -2863,7 +2871,7 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
}
}
}
-
+
//sendLocalAudioUpdates(); obsolete, used to send volume setting on position updates
std::string update(stream.str());
if(!update.empty())
@@ -4768,8 +4776,10 @@ bool LLVivoxVoiceClient::inSpatialChannel(void)
bool result = false;
if(mAudioSession)
+ {
result = mAudioSession->mIsSpatial;
-
+ }
+
return result;
}