mirror of https://github.com/encounter/SDL.git
Fixed crash on Android 8, due to bugs in AAudio implementation
This commit is contained in:
parent
c948b9366c
commit
6d5edfa733
|
@ -274,11 +274,20 @@ aaudio_Init(SDL_AudioDriverImpl *impl)
|
||||||
aaudio_result_t res;
|
aaudio_result_t res;
|
||||||
LOGI(__func__);
|
LOGI(__func__);
|
||||||
|
|
||||||
|
/* AAudio was introduced in Android 8.0, but has reference counting crash issues in that release,
|
||||||
|
* so don't use it until 8.1.
|
||||||
|
*
|
||||||
|
* See https://github.com/google/oboe/issues/40 for more information.
|
||||||
|
*/
|
||||||
|
if (SDL_GetAndroidSDKVersion() < 27) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_zero(ctx);
|
SDL_zero(ctx);
|
||||||
|
|
||||||
ctx.handle = SDL_LoadObject(LIB_AAUDIO_SO);
|
ctx.handle = SDL_LoadObject(LIB_AAUDIO_SO);
|
||||||
if (ctx.handle == NULL) {
|
if (ctx.handle == NULL) {
|
||||||
LOGI("SDL Failed to found " LIB_AAUDIO_SO);
|
LOGI("SDL couldn't find " LIB_AAUDIO_SO);
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue