From 316d6fedc54bec2e48a588a65951513f915622f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Thu, 18 Feb 2021 21:23:47 -0500
Subject: [PATCH] opensl: declare AEC interfaces as optional

Change-Id: I6ccffb6ed28255922db2ca752503c42269b982e2
---
 src/media/audio/opensl/audio_recorder.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/media/audio/opensl/audio_recorder.cpp b/src/media/audio/opensl/audio_recorder.cpp
index c057678c89..a996f63820 100644
--- a/src/media/audio/opensl/audio_recorder.cpp
+++ b/src/media/audio/opensl/audio_recorder.cpp
@@ -89,7 +89,12 @@ AudioRecorder::AudioRecorder(jami::AudioFormat sampleFormat, size_t bufSize, SLE
                                  SL_IID_ANDROIDACOUSTICECHOCANCELLATION,
                                  SL_IID_ANDROIDAUTOMATICGAINCONTROL,
                                  SL_IID_ANDROIDNOISESUPPRESSION};
-    const SLboolean req[1] = {SL_BOOLEAN_TRUE};
+    const SLboolean req[] = {SL_BOOLEAN_TRUE,
+                              SL_BOOLEAN_TRUE,
+                              SL_BOOLEAN_FALSE,
+                              SL_BOOLEAN_FALSE,
+                              SL_BOOLEAN_FALSE};
+
     SLresult result;
     result = (*slEngine)->CreateAudioRecorder(slEngine,
                                               &recObjectItf_,
@@ -104,6 +109,7 @@ AudioRecorder::AudioRecorder(jami::AudioFormat sampleFormat, size_t bufSize, SLE
     SLint32 streamType = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
     result = (*recObjectItf_)
                  ->GetInterface(recObjectItf_, SL_IID_ANDROIDCONFIGURATION, &recordConfig);
+    SLASSERT(result);
     result = (*recordConfig)
                  ->SetConfiguration(recordConfig,
                                     SL_ANDROID_KEY_RECORDING_PRESET,
-- 
GitLab