Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Bug 1703 - SDL calls a wrong JNI function on Android by Philipp Wiese…
Browse files Browse the repository at this point in the history
…mann
  • Loading branch information
gabomdq committed Feb 12, 2013
1 parent d6a8b7f commit 0e68e38
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/android/SDL_android.cpp
Expand Up @@ -430,12 +430,11 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan
}
Android_JNI_SetupThread();


__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
audioBuffer16Bit = is16Bit;
audioBufferStereo = channelCount > 1;

env->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
env->CallStaticVoidMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);

/* Allocating the audio buffer from the Java side and passing it as the return value for audioInit no longer works on
* Android >= 4.2 due to a "stale global reference" error. So now we allocate this buffer directly from this side. */
Expand Down Expand Up @@ -471,7 +470,7 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan
if (audioBufferStereo) {
audioBufferFrames /= 2;
}

return audioBufferFrames;
}

Expand Down

0 comments on commit 0e68e38

Please sign in to comment.