Merge "audio: Abort on data FMQ pointer corruption" into main am: 2222e7d599
am: 581761fa85
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3079664 Change-Id: Ied8e9a4358ee99047e3fb0cb5fac8502eb5e7fbc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
d81c41d0b0
1 changed files with 9 additions and 2 deletions
|
@ -315,7 +315,11 @@ StreamInWorkerLogic::Status StreamInWorkerLogic::cycle() {
|
|||
bool StreamInWorkerLogic::read(size_t clientSize, StreamDescriptor::Reply* reply) {
|
||||
ATRACE_CALL();
|
||||
StreamContext::DataMQ* const dataMQ = mContext->getDataMQ();
|
||||
const size_t byteCount = std::min({clientSize, dataMQ->availableToWrite(), mDataBufferSize});
|
||||
StreamContext::DataMQ::Error fmqError = StreamContext::DataMQ::Error::NONE;
|
||||
std::string fmqErrorMsg;
|
||||
const size_t byteCount = std::min(
|
||||
{clientSize, dataMQ->availableToWrite(&fmqError, &fmqErrorMsg), mDataBufferSize});
|
||||
CHECK(fmqError == StreamContext::DataMQ::Error::NONE) << fmqErrorMsg;
|
||||
const bool isConnected = mIsConnected;
|
||||
const size_t frameSize = mContext->getFrameSize();
|
||||
size_t actualFrameCount = 0;
|
||||
|
@ -587,7 +591,10 @@ StreamOutWorkerLogic::Status StreamOutWorkerLogic::cycle() {
|
|||
bool StreamOutWorkerLogic::write(size_t clientSize, StreamDescriptor::Reply* reply) {
|
||||
ATRACE_CALL();
|
||||
StreamContext::DataMQ* const dataMQ = mContext->getDataMQ();
|
||||
const size_t readByteCount = dataMQ->availableToRead();
|
||||
StreamContext::DataMQ::Error fmqError = StreamContext::DataMQ::Error::NONE;
|
||||
std::string fmqErrorMsg;
|
||||
const size_t readByteCount = dataMQ->availableToRead(&fmqError, &fmqErrorMsg);
|
||||
CHECK(fmqError == StreamContext::DataMQ::Error::NONE) << fmqErrorMsg;
|
||||
const size_t frameSize = mContext->getFrameSize();
|
||||
bool fatal = false;
|
||||
int32_t latency = mContext->getNominalLatencyMs();
|
||||
|
|
Loading…
Reference in a new issue