Increase priority for audio thread to prevent warnings and errors about "CPU pegged"

This commit is contained in:
pelya
2010-06-10 18:47:50 +03:00
parent faa64c538c
commit dd853f111c
2 changed files with 15 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ import android.media.AudioFormat;
import java.io.*;
import java.nio.ByteBuffer;
import android.util.Log;
import java.lang.Thread;
class AudioThread {
@@ -74,6 +75,13 @@ class AudioThread {
return 1;
}
public int initAudioThread()
{
// Make audio thread priority higher so audio thread won't get underrun
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
return 1;
}
private native int nativeAudioInitJavaCallbacks();
}