ソースを参照

OpenAL-soft: Add love-android-specific patches.

Miku AuahDark 3 年 前
コミット
0298822ab9
2 ファイル変更26 行追加1 行削除
  1. 5 1
      libs/openal-soft/CMakeLists.txt
  2. 21 0
      libs/openal-soft/opensl_latency.cpp

+ 5 - 1
libs/openal-soft/CMakeLists.txt

@@ -728,7 +728,7 @@ set(OPENAL_OBJS
     al/effects/dedicated.cpp
     al/effects/distortion.cpp
     al/effects/echo.cpp
-	al/effects/effects.cpp
+    al/effects/effects.cpp
     al/effects/effects.h
     al/effects/equalizer.cpp
     al/effects/fshifter.cpp
@@ -1143,6 +1143,10 @@ if(OBOE_TARGET)
         set(ALC_OBJS  ${ALC_OBJS} alc/backends/oboe.cpp alc/backends/oboe.h)
         set(BACKENDS  "${BACKENDS} Oboe,")
         set(EXTRA_LIBS ${OBOE_TARGET} ${EXTRA_LIBS})
+
+        if(MEGA)
+            set(ALC_OBJS  ${ALC_OBJS} opensl_latency.cpp)
+        endif()
     endif()
 endif()
 if(ALSOFT_REQUIRE_OBOE AND NOT HAVE_OBOE)

+ 21 - 0
libs/openal-soft/opensl_latency.cpp

@@ -0,0 +1,21 @@
+// This file is NOT part of OpenAL-soft
+
+#include <jni.h>
+
+#include "oboe/Oboe.h"
+
+extern "C"
+{
+
+JNIEXPORT void JNICALL
+Java_org_love2d_android_GameActivity_nativeSetDefaultStreamValues(
+    JNIEnv *env,
+    jclass type,
+    jint sampleRate,
+    jint framesPerBurst
+) {
+    oboe::DefaultStreamValues::SampleRate = (int32_t) sampleRate;
+    oboe::DefaultStreamValues::FramesPerBurst = (int32_t) framesPerBurst;
+}
+
+}