Stop viewer from flooding the server.
On a parcel with voice disabled, the viewer keeps requesting voice info every two frames, cycling between states stateNoChannel and stateRetrievingParcelVoiceInfo. This commit fixes that: if voice is disabled on the parcel then mAreaVoiceDisabled is set (because the url is empty) and we stop requesting voice info until the parcel changes again. If voice is enabled while we are in the stateNoChannel then we drop out of that because mNextAudioSession gets set (to stateJoiningSession). If the viewer has voice disabled, then now it drops correctly out of the stateNoChannel into stateDisabled.
This commit is contained in:
@@ -1445,7 +1445,7 @@ void LLVivoxVoiceClient::stateMachine()
|
||||
{
|
||||
setState(stateCaptureBufferPaused);
|
||||
}
|
||||
else if(checkParcelChanged() || (mNextAudioSession == NULL))
|
||||
else if(checkParcelChanged() || (!mAreaVoiceDisabled && mNextAudioSession == NULL))
|
||||
{
|
||||
// the parcel is changed, or we have no pending audio sessions,
|
||||
// so try to request the parcel voice info
|
||||
@@ -1592,7 +1592,7 @@ void LLVivoxVoiceClient::stateMachine()
|
||||
mSpatialCoordsDirty = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if(checkParcelChanged())
|
||||
{
|
||||
// if the parcel has changed, attempted to request the
|
||||
@@ -4489,6 +4489,7 @@ bool LLVivoxVoiceClient::checkParcelChanged(bool update)
|
||||
{
|
||||
mCurrentParcelLocalID = parcelLocalID;
|
||||
mCurrentRegionName = regionName;
|
||||
mAreaVoiceDisabled = false; // Now that we changed parcel, assume voice is not disabled until we get the parcel info back that says it is.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user