summaryrefslogtreecommitdiff
path: root/indra/newview/llvieweraudio.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-12 04:24:35 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-11-12 04:24:35 +0200
commit91fa31c065a582b9ead8a3d2f537c9b3d72474ee (patch)
tree50a83e42321a2b611df7c8e3f72ef452f868c591 /indra/newview/llvieweraudio.cpp
parent2d69438ee37a2224698418c2d00b19015b70b2b5 (diff)
parentf13cc44f8999a9897c77411d1296582b7bc1f08d (diff)
Downstream merge from lindenlab/viewer-serval
Diffstat (limited to 'indra/newview/llvieweraudio.cpp')
-rw-r--r--indra/newview/llvieweraudio.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 7ce9d858dd..cb20801756 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -463,24 +463,25 @@ void audio_update_volume(bool force_update)
F32 media_volume = gSavedSettings.getF32("AudioLevelMedia");
BOOL media_muted = gSavedSettings.getBOOL("MuteMedia");
media_volume = mute_volume * master_volume * media_volume;
- LLViewerMedia::setVolume( media_muted ? 0.0f : media_volume );
+ LLViewerMedia::getInstance()->setVolume( media_muted ? 0.0f : media_volume );
- // Voice
- if (LLVoiceClient::getInstance())
+ // Voice, this is parametric singleton, it gets initialized when ready
+ if (LLVoiceClient::instanceExists())
{
F32 voice_volume = gSavedSettings.getF32("AudioLevelVoice");
voice_volume = mute_volume * master_volume * voice_volume;
BOOL voice_mute = gSavedSettings.getBOOL("MuteVoice");
- LLVoiceClient::getInstance()->setVoiceVolume(voice_mute ? 0.f : voice_volume);
- LLVoiceClient::getInstance()->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic"));
+ LLVoiceClient *voice_inst = LLVoiceClient::getInstance();
+ voice_inst->setVoiceVolume(voice_mute ? 0.f : voice_volume);
+ voice_inst->setMicGain(voice_mute ? 0.f : gSavedSettings.getF32("AudioLevelMic"));
if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized")))
{
- LLVoiceClient::getInstance()->setMuteMic(true);
+ voice_inst->setMuteMic(true);
}
else
{
- LLVoiceClient::getInstance()->setMuteMic(false);
+ voice_inst->setMuteMic(false);
}
}
}