summaryrefslogtreecommitdiff
path: root/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
diff options
context:
space:
mode:
authorHaamed Gheibi <haamed@google.com>2022-02-09 14:35:06 -0800
committerHaamed Gheibi <haamed@google.com>2022-02-09 14:41:16 -0800
commitab52181d73b04e131fd72e32d69b5123a5d6892b (patch)
tree0ac86b537180b6fb97716b3058dfae44af9eaac7 /bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
parentf99b35c293439db0b7436b47b939eb8c7bf21b51 (diff)
parent4d2548cfa7b86b79a516be9b60f6b666cc9af682 (diff)
Merge TP1A.220126.001
Change-Id: Ibf6bd2c20d9927fde8b2a05dde2b58bd8faea20f
Diffstat (limited to 'bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp')
-rw-r--r--bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
index f9962fd9d9..67b7d60c0c 100644
--- a/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioSoftwareAudioProvider.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "BTAudioProviderLeAudioHW"
+#define LOG_TAG "BTAudioProviderLeAudioSW"
#include "LeAudioSoftwareAudioProvider.h"
@@ -88,6 +88,16 @@ ndk::ScopedAStatus LeAudioSoftwareAudioProvider::startSession(
channel_mode_to_channel_count(pcm_config.channelMode) *
(pcm_config.bitsPerSample / 8) * (pcm_config.dataIntervalUs / 1000) *
buffer_modifier;
+ if (data_mq_size <= 0) {
+ LOG(ERROR) << __func__ << "Unexpected audio buffer size: " << data_mq_size
+ << ", SampleRateHz: " << pcm_config.sampleRateHz
+ << ", ChannelMode: " << toString(pcm_config.channelMode)
+ << ", BitsPerSample: "
+ << static_cast<int>(pcm_config.bitsPerSample)
+ << ", DataIntervalUs: " << pcm_config.dataIntervalUs
+ << ", SessionType: " << toString(session_type_);
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
LOG(INFO) << __func__ << " - size of audio buffer " << data_mq_size
<< " byte(s)";
@@ -113,8 +123,9 @@ ndk::ScopedAStatus LeAudioSoftwareAudioProvider::onSessionReady(
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
*_aidl_return = data_mq_->dupeDesc();
+ auto desc = data_mq_->dupeDesc();
BluetoothAudioSessionReport::OnSessionStarted(session_type_, stack_iface_,
- _aidl_return, *audio_config_);
+ &desc, *audio_config_);
return ndk::ScopedAStatus::ok();
}