From 3be4edbfe4f80d7bf001629b5e05cf5c62e1c481 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Tue, 28 Nov 2023 13:43:21 +0000 Subject: [PATCH] Bug 1864143 - Reapply patches on top of libcubeb. r=cubeb-reviewers,kinetik Differential Revision: https://phabricator.services.mozilla.com/D194219 --- media/libcubeb/src/cubeb_aaudio.cpp | 4 ++++ media/libcubeb/test/test_duplex.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/media/libcubeb/src/cubeb_aaudio.cpp b/media/libcubeb/src/cubeb_aaudio.cpp index f95f7f01aeaf..d9e85c1ce597 100644 --- a/media/libcubeb/src/cubeb_aaudio.cpp +++ b/media/libcubeb/src/cubeb_aaudio.cpp @@ -11,6 +11,7 @@ #include "cubeb_resampler.h" #include "cubeb_triple_buffer.h" #include +#include #include #include #include @@ -1756,6 +1757,9 @@ const static struct cubeb_ops aaudio_ops = { 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 diff --git a/media/libcubeb/test/test_duplex.cpp b/media/libcubeb/test/test_duplex.cpp index 518f44f509e1..6a7ca98b1fdf 100644 --- a/media/libcubeb/test/test_duplex.cpp +++ b/media/libcubeb/test/test_duplex.cpp @@ -18,6 +18,8 @@ #include #include +#include "mozilla/gtest/MozHelpers.h" + // #define ENABLE_NORMAL_LOG // #define ENABLE_VERBOSE_LOG #include "common.h" @@ -206,6 +208,8 @@ TEST(cubeb, duplex_collection_change_no_unregister) cubeb * ctx; int r; + mozilla::gtest::DisableCrashReporter(); + r = common_init(&ctx, "Cubeb duplex example with collection change"); ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";