mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-11 16:49:27 +01:00
Avoid a memory copy when audio is ahead.
This commit is contained in:
1 parent
85f386c38b
commit
a17a16eda2
1 file changed
+7
-2
@@ -306,8 +306,13 @@ extern "C" jint Java_com_henrikrydgard_libnative_NativeApp_audioRender(JNIEnv* e
|
||||
short *data = env->GetShortArrayElements(array, 0);
|
||||
int samples = buf_size / 2;
|
||||
samples = NativeMix(data, samples);
|
||||
env->ReleaseShortArrayElements(array, data, 0);
|
||||
return samples * 2;
|
||||
if (samples != 0) {
|
||||
env->ReleaseShortArrayElements(array, data, 0);
|
||||
return samples * 2;
|
||||
} else {
|
||||
env->ReleaseShortArrayElements(array, data, JNI_ABORT);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user