summaryrefslogtreecommitdiffstats
path: root/media/libcubeb/0001-disable-aaudio-before-android-31.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /media/libcubeb/0001-disable-aaudio-before-android-31.patch
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'media/libcubeb/0001-disable-aaudio-before-android-31.patch')
-rw-r--r--media/libcubeb/0001-disable-aaudio-before-android-31.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/media/libcubeb/0001-disable-aaudio-before-android-31.patch b/media/libcubeb/0001-disable-aaudio-before-android-31.patch
new file mode 100644
index 0000000000..36519edcb2
--- /dev/null
+++ b/media/libcubeb/0001-disable-aaudio-before-android-31.patch
@@ -0,0 +1,41 @@
+diff --git a/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp
+--- a/src/cubeb_aaudio.cpp
++++ b/src/cubeb_aaudio.cpp
+@@ -6,16 +6,17 @@
+ */
+ #include "cubeb-internal.h"
+ #include "cubeb/cubeb.h"
+ #include "cubeb_android.h"
+ #include "cubeb_log.h"
+ #include "cubeb_resampler.h"
+ #include "cubeb_triple_buffer.h"
+ #include <aaudio/AAudio.h>
++#include <android/api-level.h>
+ #include <atomic>
+ #include <cassert>
+ #include <chrono>
+ #include <condition_variable>
+ #include <cstdint>
+ #include <cstring>
+ #include <dlfcn.h>
+ #include <inttypes.h>
+@@ -1700,16 +1701,19 @@ const static struct cubeb_ops aaudio_ops
+ /*.stream_get_current_device =*/nullptr,
+ /*.stream_device_destroy =*/nullptr,
+ /*.stream_register_device_changed_callback =*/nullptr,
+ /*.register_device_collection_changed =*/nullptr};
+
+ extern "C" /*static*/ int
+ aaudio_init(cubeb ** context, char const * /* context_name */)
+ {
++ if (android_get_device_api_level() <= 30) {
++ return CUBEB_ERROR;
++ }
+ // load api
+ void * libaaudio = nullptr;
+ #ifndef DISABLE_LIBAAUDIO_DLOPEN
+ libaaudio = dlopen("libaaudio.so", RTLD_NOW);
+ if (!libaaudio) {
+ return CUBEB_ERROR;
+ }
+