src/core/android/SDL_android.cpp
changeset 7130 28df4f1a1712
parent 7095 79ca4d26d4b3
child 7149 534891ad4897
equal deleted inserted replaced
7129:538dd99173de 7130:28df4f1a1712
   420 
   420 
   421 extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
   421 extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
   422 {
   422 {
   423     int audioBufferFrames;
   423     int audioBufferFrames;
   424 
   424 
   425     int status;
       
   426     JNIEnv *env = Android_JNI_GetEnv();
   425     JNIEnv *env = Android_JNI_GetEnv();
   427 
   426 
   428     if (!env) {
   427     if (!env) {
   429         LOGE("callback_handler: failed to attach current thread");
   428         LOGE("callback_handler: failed to attach current thread");
   430     }
   429     }
   494     /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
   493     /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
   495 }
   494 }
   496 
   495 
   497 extern "C" void Android_JNI_CloseAudioDevice()
   496 extern "C" void Android_JNI_CloseAudioDevice()
   498 {
   497 {
   499     int status;
       
   500     JNIEnv *env = Android_JNI_GetEnv();
   498     JNIEnv *env = Android_JNI_GetEnv();
   501 
   499 
   502     env->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
   500     env->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
   503 
   501 
   504     if (audioBuffer) {
   502     if (audioBuffer) {