summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llwebrtc/llwebrtc.cpp4
-rw-r--r--indra/newview/llvoicewebrtc.cpp12
-rw-r--r--indra/newview/llvoicewebrtc.h2
3 files changed, 13 insertions, 5 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 862325c3f1..93981e4076 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -37,6 +37,8 @@
namespace llwebrtc
{
+const float VOLUME_SCALE_WEBRTC = 3.0f;
+
void LLWebRTCImpl::init()
{
mAnswerReceived = false;
@@ -356,7 +358,7 @@ void LLWebRTCImpl::setSpeakerVolume(float volume)
{
webrtc::AudioTrackInterface* audio_track = static_cast<webrtc::AudioTrackInterface*>(track);
webrtc::AudioSourceInterface* source = audio_track->GetSource();
- source->SetVolume(10.0 * volume);
+ source->SetVolume(VOLUME_SCALE_WEBRTC * volume);
}
}
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index bbe54018e8..d66435e2bc 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -833,7 +833,6 @@ void LLWebRTCVoiceClient::OnVoiceAccountProvisioned(const LLSD& result)
<< (voicePassword.empty() ? "not set" : "set") << " channel sdp " << channelSDP << LL_ENDL;
setLoginInfo(voiceUserName, voicePassword, channelSDP);
- setVoiceControlStateUnless(VOICE_STATE_SESSION_ESTABLISHED, VOICE_STATE_SESSION_RETRY);
}
void LLWebRTCVoiceClient::OnVoiceAccountProvisionFailure(std::string url, int retries, LLSD body, const LLSD& result)
@@ -1518,6 +1517,10 @@ bool LLWebRTCVoiceClient::runSession(const sessionStatePtr_t &session)
{
return false;
}
+ if (getVoiceControlState() == VOICE_STATE_SESSION_RETRY)
+ {
+ break;
+ }
if (mSessionTerminateRequested)
{
@@ -2825,17 +2828,20 @@ void LLWebRTCVoiceClient::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterface *
{
LL_INFOS("Voice") << "On AudioEstablished." << LL_ENDL;
mWebRTCAudioInterface = audio_interface;
+ float speaker_volume = 0;
audio_interface->setMute(true);
{
LLMutexLock lock(&mVoiceStateMutex);
-
- audio_interface->setSpeakerVolume(mSpeakerVolume);
+ speaker_volume = mSpeakerVolume;
}
+ audio_interface->setSpeakerVolume(mSpeakerVolume);
+ setVoiceControlStateUnless(VOICE_STATE_SESSION_ESTABLISHED, VOICE_STATE_SESSION_RETRY);
}
void LLWebRTCVoiceClient::OnRenegotiationNeeded()
{
LL_INFOS("Voice") << "On Renegotiation Needed." << LL_ENDL;
+ mRelogRequested = TRUE;
setVoiceControlStateUnless(VOICE_STATE_SESSION_RETRY);
}
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index e040552ab2..0dad2909d4 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -829,7 +829,7 @@ private:
bool mSpeakerVolumeDirty;
bool mSpeakerMuteDirty;
- int mSpeakerVolume;
+ float mSpeakerVolume;
int mMicVolume;
bool mMicVolumeDirty;