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-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /media/libcubeb/0001-disable-aaudio-before-android-31.patch
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
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;
+ }
+