mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Align EffectContext workbuffer size to FMQ size
Bug: 361370596 Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit Change-Id: I0d424914566ff3b8c0e13d0c8f08d138761e2ea0
This commit is contained in:
@@ -63,13 +63,18 @@ void EffectContext::resetBuffer() {
|
||||
}
|
||||
|
||||
void EffectContext::dupeFmqWithReopen(IEffect::OpenEffectReturn* effectRet) {
|
||||
const size_t inBufferSizeInFloat = mCommon.input.frameCount * mInputFrameSize / sizeof(float);
|
||||
const size_t outBufferSizeInFloat =
|
||||
mCommon.output.frameCount * mOutputFrameSize / sizeof(float);
|
||||
const size_t bufferSize = std::max(inBufferSizeInFloat, outBufferSizeInFloat);
|
||||
if (!mInputMQ) {
|
||||
mInputMQ = std::make_shared<DataMQ>(mCommon.input.frameCount * mInputFrameSize /
|
||||
sizeof(float));
|
||||
mInputMQ = std::make_shared<DataMQ>(inBufferSizeInFloat);
|
||||
}
|
||||
if (!mOutputMQ) {
|
||||
mOutputMQ = std::make_shared<DataMQ>(mCommon.output.frameCount * mOutputFrameSize /
|
||||
sizeof(float));
|
||||
mOutputMQ = std::make_shared<DataMQ>(outBufferSizeInFloat);
|
||||
}
|
||||
if (mWorkBuffer.size() != bufferSize) {
|
||||
mWorkBuffer.resize(bufferSize);
|
||||
}
|
||||
dupeFmq(effectRet);
|
||||
}
|
||||
@@ -222,8 +227,6 @@ RetCode EffectContext::updateIOFrameSize(const Parameter::Common& common) {
|
||||
}
|
||||
|
||||
if (needUpdateMq) {
|
||||
mWorkBuffer.resize(std::max(common.input.frameCount * mInputFrameSize / sizeof(float),
|
||||
common.output.frameCount * mOutputFrameSize / sizeof(float)));
|
||||
return notifyDataMqUpdate();
|
||||
}
|
||||
return RetCode::SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user