Added AllowLargeSounds setting to disable v2 sound-decode strictness

Conflicts:

	indra/newview/app_settings/settings.xml
This commit is contained in:
Shyotl
2011-06-09 16:53:46 -05:00
parent c57b97c8df
commit 25bb20046b
7 changed files with 29 additions and 1 deletions

View File

@@ -249,7 +249,7 @@ BOOL LLVorbisDecodeState::initDecode()
llwarns << "Bad sound caught by zmagic" << llendl;
abort_decode = true;
}
else
else if(!gAudiop->getAllowLargeSounds())
{
// </edit>
//Much more restrictive than zmagic. Perhaps make toggleable.

View File

@@ -115,6 +115,8 @@ void LLAudioEngine::setDefaults()
for (U32 i = 0; i < LLAudioEngine::AUDIO_TYPE_COUNT; i++)
mSecondaryGain[i] = 1.0f;
mAllowLargeSounds = false;
}

View File

@@ -187,6 +187,8 @@ public:
bool updateBufferForData(LLAudioData *adp, const LLUUID &audio_uuid = LLUUID::null);
void setAllowLargeSounds(bool allow) { mAllowLargeSounds = allow ;}
bool getAllowLargeSounds() const {return mAllowLargeSounds;}
// Asset callback when we're retrieved a sound from the asset server.
void startNextTransfer();
@@ -260,6 +262,8 @@ protected:
private:
void setDefaults();
LLStreamingAudioInterface *mStreamingAudioImpl;
bool mAllowLargeSounds;
};

View File

@@ -107,6 +107,7 @@ bool LLAudioEngine_FMOD::init(const S32 num_channels, void* userdata)
// This means we also try to play audio when minimized,
// so we manually handle muting in that case. JC
fmod_flags |= FSOUND_INIT_GLOBALFOCUS;
fmod_flags |= FSOUND_INIT_DSOUND_HRTF_FULL;
#endif
#if LL_LINUX

View File

@@ -9,6 +9,17 @@
<string>settings_rlv.xml</string>
</array>
<key>AllowLargeSounds</key>
<map>
<key>Comment</key>
<string>Bypass stricter sound size/sample checks, which were introduced in SL2.x, for sound decoding.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FloaterAvatarTextRect</key>
<map>
<key>Comment</key>

View File

@@ -687,6 +687,8 @@ bool idle_startup()
if(init)
{
gAudiop->setMuted(TRUE);
if(gSavedSettings.getBOOL("AllowLargeSounds"))
gAudiop->setAllowLargeSounds(true);
}
else
{

View File

@@ -583,6 +583,12 @@ static bool handlePhoenixNameSystemChanged(const LLSD& newvalue)
}
// [/Ansariel: Display name support]
static bool handleAllowLargeSounds(const LLSD& newvalue)
{
if(gAudiop)
gAudiop->setAllowLargeSounds(newvalue.asBoolean());
return true;
}
////////////////////////////////////////////////////////////////////////////
void settings_setup_listeners()
{
@@ -754,6 +760,8 @@ void settings_setup_listeners()
// [Ansariel: Display name support]
gSavedSettings.getControl("PhoenixNameSystem")->getSignal()->connect(boost::bind(&handlePhoenixNameSystemChanged, _1));
// [/Ansariel: Display name support]
gSavedSettings.getControl("AllowLargeSounds")->getSignal()->connect(boost::bind(&handleAllowLargeSounds, _1));
}
template <> eControlType get_control_type<U32>(const U32& in, LLSD& out)