Fixed OpenAL not linking with SDL2

This commit is contained in:
Sergii Pylypenko
2022-01-03 00:06:17 +02:00
parent dd57a9afbd
commit 466c97d06f
2 changed files with 5 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ LOCAL_MODULE := openal
APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/src -type d))
LOCAL_C_INCLUDES := $(foreach D, $(APP_SUBDIRS), $(LOCAL_PATH)/$(D)) $(LOCAL_PATH)/include
LOCAL_CFLAGS := -O3 -DHAVE_CONFIG_H -DAL_ALEXT_PROTOTYPES
LOCAL_CFLAGS := -O3 -DHAVE_CONFIG_H -DAL_ALEXT_PROTOTYPES $(if $(filter 1.2, $(SDL_VERSION)), -DAL_SDL_ONPAUSE_CALLBACK)
LOCAL_CPP_EXTENSION := .cpp

View File

@@ -30,9 +30,11 @@
typedef void ( * SDL_ANDROID_ApplicationPutToBackgroundCallback_t ) (void);
#ifdef AL_SDL_ONPAUSE_CALLBACK
extern int SDL_ANDROID_SetOpenALPutToBackgroundCallback(
SDL_ANDROID_ApplicationPutToBackgroundCallback_t PutToBackground,
SDL_ANDROID_ApplicationPutToBackgroundCallback_t Restored );
#endif
static int doPause=0;
int resumeHandled;
@@ -154,7 +156,9 @@ static ALCboolean android_open_playback(ALCdevice *device, const ALCchar *device
int channels;
int bytes;
#ifdef AL_SDL_ONPAUSE_CALLBACK
SDL_ANDROID_SetOpenALPutToBackgroundCallback(al_android_pause_playback, al_android_resume_playback);
#endif
if (!cAudioTrack)
{
/* Cache AudioTrack class and it's method id's