summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 673a760a81..673f26b13b 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -296,7 +296,6 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mDevicesListUpdated(false),
mAudioSession(), // TBD - should be NULL
- mAudioSessionChanged(false),
mNextAudioSession(),
mCurrentParcelLocalID(0),
@@ -1651,7 +1650,6 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
LL_INFOS("Voice") << "Adding or joining voice session " << nextSession->mHandle << LL_ENDL;
mAudioSession = nextSession;
- mAudioSessionChanged = true;
if (!mAudioSession || !mAudioSession->mReconnect)
{
mNextAudioSession.reset();
@@ -1908,9 +1906,8 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
sessionStatePtr_t oldSession = mAudioSession;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); // needs mAudioSession for uri
mAudioSession.reset();
- // We just notified status observers about this change. Don't do it again.
- mAudioSessionChanged = false;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -1918,9 +1915,9 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
else
{
LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL;
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
}
- notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
// Always reset the terminate request flag when we get here.
// Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves
@@ -3842,7 +3839,6 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session)
sessionStatePtr_t oldSession = mAudioSession;
mAudioSession = session;
- mAudioSessionChanged = true;
// The old session may now need to be deleted.
reapSession(oldSession);
@@ -5152,7 +5148,7 @@ bool LLVivoxVoiceClient::inProximalChannel()
return result;
}
-std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
+std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) const
{
std::string result;
result = "sip:";
@@ -5163,6 +5159,14 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id)
return result;
}
+LLSD LLVivoxVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const
+{
+ LLSD result;
+ result["channel_uri"] = sipURIFromID(id);
+ result["voice_server_type"] = VIVOX_VOICE_SERVER_TYPE;
+ return result;
+}
+
std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
{
std::string result;
@@ -5177,7 +5181,7 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar)
return result;
}
-std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid)
+std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) const
{
std::string result;
@@ -6157,7 +6161,6 @@ void LLVivoxVoiceClient::deleteSession(const sessionStatePtr_t &session)
if(mAudioSession == session)
{
mAudioSession.reset();
- mAudioSessionChanged = true;
}
// ditto for the next audio session
@@ -6266,9 +6269,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
}
}
+ LLSD channel_info = getAudioSessionChannelInfo();
LL_DEBUGS("Voice")
<< " " << LLVoiceClientStatusObserver::status2string(status)
- << ", session channelInfo " << getAudioSessionChannelInfo()
+ << ", session channelInfo " << channel_info
<< ", proximal is " << inSpatialChannel()
<< LL_ENDL;
@@ -6283,7 +6287,7 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
)
{
LLVoiceClientStatusObserver* observer = *it;
- observer->onChange(status, getAudioSessionChannelInfo(), inSpatialChannel());
+ observer->onChange(status, channel_info, inSpatialChannel());
// In case onError() deleted an entry.
it = mStatusObservers.upper_bound(observer);
}