Fixes audio crash and issues w/ audio playback (#1633)

This was caused by the main thread audio update not being called all the
time, especially Editor Game mode.

The crash was due to main thread containers not being processed and
emptied of their requests.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
This commit is contained in:
amzn-phist
2021-06-29 10:54:27 -05:00
committed by GitHub
parent f01587c159
commit 75e7472cda
6 changed files with 2 additions and 42 deletions
+2 -17
View File
@@ -352,8 +352,6 @@ CSystem::CSystem(SharedEnvironmentInstance* pSharedEnvironment)
AZ::Debug::Trace::Instance().Init();
}
m_bNeedDoWorkDuringOcclusionChecks = false;
m_eRuntimeState = ESYSTEM_EVENT_LEVEL_UNLOAD;
m_bHasRenderedErrorMessage = false;
@@ -948,16 +946,12 @@ bool CSystem::UpdatePostTickBus(int updateFlags, int /*nPauseMode*/)
}
//////////////////////////////////////////////////////////////////////
//update sound system part 2
if (!g_cvars.sys_deferAudioUpdateOptim && !m_bNoUpdate)
// Update sound system
if (!m_bNoUpdate)
{
FRAME_PROFILER("SysUpdate:UpdateAudioSystems", this, PROFILE_SYSTEM);
UpdateAudioSystems();
}
else
{
m_bNeedDoWorkDuringOcclusionChecks = true;
}
//Now update frame statistics
CTimeValue cur_time = gEnv->pTimer->GetAsyncTime();
@@ -1004,15 +998,6 @@ bool CSystem::UpdateLoadtime()
return !IsQuitting();
}
void CSystem::DoWorkDuringOcclusionChecks()
{
if (g_cvars.sys_deferAudioUpdateOptim && !m_bNoUpdate)
{
UpdateAudioSystems();
m_bNeedDoWorkDuringOcclusionChecks = false;
}
}
void CSystem::UpdateAudioSystems()
{
AZ_TRACE_METHOD();