From c53ce73469a1cbb25e72511a8a2e23b7bfe4dfb8 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 6 Jan 2011 16:53:31 -0500 Subject: STORM-830 Volume slider isn't properly remembered if set to zero There is an edge case in setMasterGain during startup which prevents setInternalGain from being called if the master volume setting and mInternalGain both equal 0. In llaudioengine.cpp setting mInternalGain to a very low but non-zero value fixes this issue. --- indra/llaudio/llaudioengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index c9cb1cd6e7..8baba79f59 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -97,7 +97,10 @@ void LLAudioEngine::setDefaults() } mMasterGain = 1.f; - mInternalGain = 0.f; + // Setting mInternalGain to a very low but non-zero value fixes the issue reported in STORM-830. + // There is an edge case in setMasterGain during startup which prevents setInternalGain from + // being called if the master volume setting and mInternalGain both equal 0. + mInternalGain = 0.0000000001f; mNextWindUpdate = 0.f; mStreamingAudioImpl = NULL; -- cgit v1.2.3 From d67f04da83c11707f2c4214b94c24d9cd12a16b6 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 10 Jan 2011 17:24:34 -0500 Subject: STORM-830 Per Aleric's and Q's suggestion set initial value of mInternalGain to -1 --- indra/llaudio/llaudioengine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 8baba79f59..5e540ad8c5 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -97,10 +97,11 @@ void LLAudioEngine::setDefaults() } mMasterGain = 1.f; - // Setting mInternalGain to a very low but non-zero value fixes the issue reported in STORM-830. + // Setting mInternalGain to an out of range value fixes the issue reported in STORM-830. // There is an edge case in setMasterGain during startup which prevents setInternalGain from - // being called if the master volume setting and mInternalGain both equal 0. - mInternalGain = 0.0000000001f; + // being called if the master volume setting and mInternalGain both equal 0, so using -1 forces + // the if statement in setMasterGain to execute when the viewer starts up. + mInternalGain = -1.f; mNextWindUpdate = 0.f; mStreamingAudioImpl = NULL; -- cgit v1.2.3