Browse Source

Fixed Android build with audio disabled

These functions are called by the Android event code regardless of whether audio is enabled

Fixes https://github.com/libsdl-org/SDL/issues/10418
Sam Lantinga 1 year ago
parent
commit
062caeaa4b
2 changed files with 18 additions and 0 deletions
  1. 9 0
      src/audio/aaudio/SDL_aaudio.h
  2. 9 0
      src/audio/openslES/SDL_openslES.h

+ 9 - 0
src/audio/aaudio/SDL_aaudio.h

@@ -23,7 +23,16 @@
 #ifndef SDL_aaudio_h_
 #define SDL_aaudio_h_
 
+#ifdef SDL_AUDIO_DRIVER_AAUDIO
+
 extern void AAUDIO_ResumeDevices(void);
 extern void AAUDIO_PauseDevices(void);
 
+#else
+
+#define AAUDIO_ResumeDevices()
+#define AAUDIO_PauseDevices()
+
+#endif
+
 #endif // SDL_aaudio_h_

+ 9 - 0
src/audio/openslES/SDL_openslES.h

@@ -23,7 +23,16 @@
 #ifndef SDL_openslesaudio_h_
 #define SDL_openslesaudio_h_
 
+#ifdef SDL_AUDIO_DRIVER_OPENSLES
+
 extern void OPENSLES_ResumeDevices(void);
 extern void OPENSLES_PauseDevices(void);
 
+#else
+
+#define OPENSLES_ResumeDevices()
+#define OPENSLES_PauseDevices()
+
+#endif
+
 #endif // SDL_openslesaudio_h_