mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
PowerSaver: close audio during PS when possible
If SDL audio device is paused, deinit audio when PS mode kicks in so that full power savings can be achieved.
This commit is contained in:
parent
c08c24e615
commit
1bfcfb1f16
|
@ -1,4 +1,5 @@
|
|||
#include "PowerSaver.h"
|
||||
#include "AudioManager.h"
|
||||
#include "Settings.h"
|
||||
#include <string.h>
|
||||
|
||||
|
@ -17,6 +18,9 @@ void PowerSaver::init()
|
|||
|
||||
int PowerSaver::getTimeout()
|
||||
{
|
||||
if (SDL_GetAudioStatus() == SDL_AUDIO_PAUSED)
|
||||
AudioManager::getInstance()->deinit();
|
||||
|
||||
// Used only for SDL_WaitEventTimeout. Use `getMode()` for modes.
|
||||
return mRunningScreenSaver ? mWakeupTimeout : mScreenSaverTimeout;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue