Bug 1876318 - migrate firefox-android release promotion. r=bhearsum,releng-reviewers
[gecko.git] / media / libcubeb / 0001-disable-aaudio-before-android-31.patch
blob36519edcb259263cb866125ea19a60e895fb0623
1 diff --git a/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp
2 --- a/src/cubeb_aaudio.cpp
3 +++ b/src/cubeb_aaudio.cpp
4 @@ -6,16 +6,17 @@
5 */
6 #include "cubeb-internal.h"
7 #include "cubeb/cubeb.h"
8 #include "cubeb_android.h"
9 #include "cubeb_log.h"
10 #include "cubeb_resampler.h"
11 #include "cubeb_triple_buffer.h"
12 #include <aaudio/AAudio.h>
13 +#include <android/api-level.h>
14 #include <atomic>
15 #include <cassert>
16 #include <chrono>
17 #include <condition_variable>
18 #include <cstdint>
19 #include <cstring>
20 #include <dlfcn.h>
21 #include <inttypes.h>
22 @@ -1700,16 +1701,19 @@ const static struct cubeb_ops aaudio_ops
23 /*.stream_get_current_device =*/nullptr,
24 /*.stream_device_destroy =*/nullptr,
25 /*.stream_register_device_changed_callback =*/nullptr,
26 /*.register_device_collection_changed =*/nullptr};
28 extern "C" /*static*/ int
29 aaudio_init(cubeb ** context, char const * /* context_name */)
31 + if (android_get_device_api_level() <= 30) {
32 + return CUBEB_ERROR;
33 + }
34 // load api
35 void * libaaudio = nullptr;
36 #ifndef DISABLE_LIBAAUDIO_DLOPEN
37 libaaudio = dlopen("libaaudio.so", RTLD_NOW);
38 if (!libaaudio) {
39 return CUBEB_ERROR;