mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-05 02:35:29 +02:00
Set some half reasonable defaults when there's no optimal sample rate available
This commit is contained in:
1 parent
a506ba2e83
commit
d2f95b9190
1 file changed
+6
-2
@@ -249,10 +249,14 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioInit(JNIEnv *, jclass) {
|
||||
sampleRate = optimalSampleRate;
|
||||
if (NativeQueryConfig("force44khz") != "0") {
|
||||
if (NativeQueryConfig("force44khz") != "0" || optimalSampleRate == 0) {
|
||||
sampleRate = 44100;
|
||||
}
|
||||
framesPerBuffer = optimalFramesPerBuffer;
|
||||
if (optimalFramesPerBuffer > 0) {
|
||||
framesPerBuffer = optimalFramesPerBuffer;
|
||||
} else {
|
||||
framesPerBuffer = 512;
|
||||
}
|
||||
ILOG("NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: %i", optimalFramesPerBuffer, optimalSampleRate, sampleRate);
|
||||
AndroidAudio_Init(&NativeMix, library_path, framesPerBuffer, sampleRate);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user