mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
audio: Enable more compile time checks in the default impl
Enable "-Wall, Wextra, Werror, Wthread-safety", fix discovered issues. Bug: 205884982 Test: m Change-Id: I0a8d3095dd24dbb3bc7cf6569c1f71945cd55168
This commit is contained in:
@@ -187,7 +187,7 @@ ndk::ScopedAStatus Module::createStreamContext(
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
LOG(DEBUG) << __func__ << ": frame size " << frameSize << " bytes";
|
||||
if (frameSize > kMaximumStreamBufferSizeBytes / in_bufferSizeFrames) {
|
||||
if (frameSize > static_cast<size_t>(kMaximumStreamBufferSizeBytes / in_bufferSizeFrames)) {
|
||||
LOG(ERROR) << __func__ << ": buffer size " << in_bufferSizeFrames
|
||||
<< " frames is too large, maximum size is "
|
||||
<< kMaximumStreamBufferSizeBytes / frameSize;
|
||||
@@ -281,7 +281,7 @@ ndk::ScopedAStatus Module::findPortIdForNewStream(int32_t in_portConfigId, Audio
|
||||
<< " does not correspond to a mix port";
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
const int32_t maxOpenStreamCount = portIt->ext.get<AudioPortExt::Tag::mix>().maxOpenStreamCount;
|
||||
const size_t maxOpenStreamCount = portIt->ext.get<AudioPortExt::Tag::mix>().maxOpenStreamCount;
|
||||
if (maxOpenStreamCount != 0 && mStreams.count(portId) >= maxOpenStreamCount) {
|
||||
LOG(ERROR) << __func__ << ": port id " << portId
|
||||
<< " has already reached maximum allowed opened stream count: "
|
||||
|
||||
Reference in New Issue
Block a user