AAudio: add aaudio pause/resume function to android events loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c
index 14cfc1b..4124cac 100644
--- a/src/video/android/SDL_androidevents.c
+++ b/src/video/android/SDL_androidevents.c
@@ -48,6 +48,16 @@ static void openslES_ResumeDevices(void) {}
static void openslES_PauseDevices(void) {}
#endif
+#if !SDL_AUDIO_DISABLED && SDL_AUDIO_DRIVER_AAUDIO
+extern void aaudio_ResumeDevices(void);
+extern void aaudio_PauseDevices(void);
+#else
+static void aaudio_ResumeDevices(void) {}
+static void aaudio_PauseDevices(void) {}
+#endif
+
+
+
/* Number of 'type' events in the event queue */
static int
SDL_NumberOfEvents(Uint32 type)
@@ -110,6 +120,7 @@ Android_PumpEvents_Blocking(_THIS)
ANDROIDAUDIO_PauseDevices();
openslES_PauseDevices();
+ aaudio_PauseDevices();
if (SDL_SemWait(Android_ResumeSem) == 0) {
@@ -122,6 +133,7 @@ Android_PumpEvents_Blocking(_THIS)
ANDROIDAUDIO_ResumeDevices();
openslES_ResumeDevices();
+ aaudio_ResumeDevices();
/* Restore the GL Context from here, as this operation is thread dependent */
if (!isContextExternal && !SDL_HasEvent(SDL_QUIT)) {
@@ -178,6 +190,7 @@ Android_PumpEvents_NonBlocking(_THIS)
if (videodata->pauseAudio) {
ANDROIDAUDIO_PauseDevices();
openslES_PauseDevices();
+ aaudio_PauseDevices();
}
backup_context = 0;
@@ -196,6 +209,7 @@ Android_PumpEvents_NonBlocking(_THIS)
if (videodata->pauseAudio) {
ANDROIDAUDIO_ResumeDevices();
openslES_ResumeDevices();
+ aaudio_ResumeDevices();
}
/* Restore the GL Context from here, as this operation is thread dependent */