Moved to NDK r4 and SDK 2.2, updated readme, still catching the crash in audio output with Android 2.2 - added lot of debug spam

This commit is contained in:
pelya
2010-06-25 18:52:45 +03:00
parent ee1dde5745
commit 09388a7599
14 changed files with 153 additions and 55 deletions

View File

@@ -34,11 +34,18 @@ class AudioThread {
public int fillBuffer()
{
mAudio.write( mAudioBuffer, 0, mAudioBuffer.length );
Log.i("libSDL", "JNI: fillBuffer() enter, mAudioBuffer len " + String.valueOf(mAudioBuffer.length));
int ret = 0;
try{
ret = mAudio.write( mAudioBuffer, 0, mAudioBuffer.length );
} catch( Throwable t ) {
Log.i("libSDL", "JNI: fillBuffer() caught exception!");
}
Log.i("libSDL", "JNI: fillBuffer() exit, written " + String.valueOf(ret));
return 1;
}
public byte[] initAudio(int rate, int channels, int encoding, int bufSize)
public int initAudio(int rate, int channels, int encoding, int bufSize)
{
if( mAudio == null )
{
@@ -60,7 +67,12 @@ class AudioThread {
AudioTrack.MODE_STREAM );
mAudio.play();
}
return mAudioBuffer;
return mAudioBuffer.length;
}
public byte[] getBuffer()
{
return mAudioBuffer;
}
public int deinitAudio()