diff --git a/shell/android/jni/src/Android.cpp b/shell/android/jni/src/Android.cpp index 115c6000d..93b6748af 100644 --- a/shell/android/jni/src/Android.cpp +++ b/shell/android/jni/src/Android.cpp @@ -14,6 +14,7 @@ #include "cfg/cfg.h" #include "rend/TexCache.h" #include "hw/maple/maple_devs.h" +#include "hw/maple/maple_if.h" #include "util.h" @@ -214,6 +215,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_JNIdc_setupMic(JNIEnv *env,jobj { sipemu = env->NewGlobalRef(sip); getmicdata = env->GetMethodID(env->GetObjectClass(sipemu),"getData","()[B"); + delete MapleDevices[0][1]; mcfg_Create(MDT_Microphone,0,1); } diff --git a/shell/android/src/com/reicast/emulator/SipEmulator.java b/shell/android/src/com/reicast/emulator/SipEmulator.java index 828fa4917..bb5afd88d 100644 --- a/shell/android/src/com/reicast/emulator/SipEmulator.java +++ b/shell/android/src/com/reicast/emulator/SipEmulator.java @@ -1,6 +1,5 @@ package com.reicast.emulator; -import java.util.LinkedList; import java.util.concurrent.ConcurrentLinkedQueue; import android.media.AudioFormat; @@ -37,7 +36,6 @@ public class SipEmulator extends Thread { init(); - } private void init(){ @@ -55,7 +53,6 @@ public class SipEmulator extends Thread { continueRecording = false; firstGet = true; } - public void startRecording(){ Log.d(TAG, "SipEmulator startRecording called"); @@ -97,26 +94,15 @@ public class SipEmulator extends Thread { public void run() { Log.d(TAG, "recordThread starting"); - //sleep to let some data come in - // try { - // Thread.sleep(TIME_TO_WAIT_BETWEEN_POLLS); - // } catch (InterruptedException e) { - // e.printStackTrace(); - // } while(continueRecording){ byte[] freshData = new byte[ONE_BLIP_SIZE]; // read blocks int bytesRead = record.read(freshData, 0, ONE_BLIP_SIZE); //Log.d(TAG, "recordThread recorded: "+bytesRead); - bytesReadBuffer.add(freshData); - /* - try { - Thread.sleep(TIME_TO_WAIT_BETWEEN_POLLS); - } catch (InterruptedException e) { - e.printStackTrace(); + if(!firstGet){ + bytesReadBuffer.add(freshData); } - */ } }