Android: Empty audio buffers when returning from activity

This commit is contained in:
Connor McLaughlin 2020-11-07 22:03:09 +10:00
parent f68ad7d0c3
commit 8cb89636eb
2 changed files with 5 additions and 2 deletions

View File

@ -473,9 +473,9 @@ void AndroidHostInterface::SurfaceChanged(ANativeWindow* surface, int format, in
m_display->ChangeRenderWindow(wi);
if (surface && System::GetState() == System::State::Paused)
System::SetState(System::State::Running);
PauseSystem(false);
else if (!surface && System::IsRunning())
System::SetState(System::State::Paused);
PauseSystem(true);
}
}

View File

@ -164,7 +164,10 @@ void CommonHostInterface::PauseSystem(bool paused)
return;
System::SetState(paused ? System::State::Paused : System::State::Running);
if (!paused)
m_audio_stream->EmptyBuffers();
m_audio_stream->PauseOutput(paused);
OnSystemPaused(paused);
UpdateSpeedLimiterState();