Increase priority for audio thread to prevent warnings and errors about "CPU pegged"
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user