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

Commit

Permalink
Removed code from GetPrimtiveArrayCritical() experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 13, 2011
1 parent 497f696 commit 4a6b0b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SDL_android.cpp
Expand Up @@ -211,14 +211,11 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan

extern "C" void * Android_JNI_GetAudioBuffer()
{
//jboolean isCopy = JNI_FALSE;
//audioBufferPinned = mAudioEnv->GetPrimitiveArrayCritical((jarray)audioBuffer, &isCopy);
return audioBufferPinned;
}

extern "C" void Android_JNI_WriteAudioBuffer()
{
//mAudioEnv->ReleasePrimitiveArrayCritical((jarray)audioBuffer, audioBufferPinned, 0);
if (audioBuffer16Bit) {
mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
mAudioEnv->CallStaticVoidMethod(mActivityInstance, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
Expand All @@ -234,8 +231,11 @@ extern "C" void Android_JNI_CloseAudioDevice()
{
mEnv->CallStaticVoidMethod(mActivityInstance, midAudioQuit);

mEnv->DeleteGlobalRef(audioBuffer);
audioBuffer = NULL;
if (audioBuffer) {
mEnv->DeleteGlobalRef(audioBuffer);
audioBuffer = NULL;
audioBufferPinned = NULL;
}
}

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 4a6b0b8

Please sign in to comment.