(Android) Commented out a CPU utilization workaround as OpenSL ES is now used instead of AAudio and it does not have this problem

This commit is contained in:
Leon Styhre 2023-12-30 19:38:16 +01:00
parent 63c21fcea0
commit d108320a07

View file

@ -497,15 +497,22 @@ void applicationLoop()
#if defined(__ANDROID__)
// Workaround for an SDL issue where SDL_PollEvent() consumes all available CPU
// cycles when the application has been stopped.
while (AndroidVariables::sPaused)
SDL_Delay(10);
// cycles when the application has been stopped. This issue is only present when
// using the AAudio driver and as OpenSL ES is now used instead this code can be
// disabled for the time being.
// while (AndroidVariables::sPaused)
// SDL_Delay(10);
#endif
if (SDL_PollEvent(&event)) {
do {
InputManager::getInstance().parseEvent(event);
// if (event.type == SDL_APP_WILLENTERBACKGROUND) {
// AndroidVariables::sPaused = true;
// break;
// }
if (event.type == SDL_QUIT)
#if !defined(__EMSCRIPTEN__)
return;
@ -595,6 +602,11 @@ int main(int argc, char* argv[])
Log::setReportingLevel(LogDebug);
}
#if defined(__ANDROID__)
// Utils::Platform::Android::startConfigurator();
Utils::Platform::Android::setROMDirectory();
#endif
#if defined(FREEIMAGE_LIB)
// Call this ONLY when linking with FreeImage as a static library.
FreeImage_Initialise();
@ -944,11 +956,6 @@ int main(int argc, char* argv[])
SDL_SetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD, "0");
}
#if defined(__ANDROID__)
Utils::Platform::Android::requestStoragePermission();
Utils::Platform::Android::setROMDirectory();
#endif
MameNames::getInstance();
ThemeData::populateThemes();
loadSystemsReturnCode loadSystemsStatus {loadSystemConfigFile()};