Fix the media filter buffer issue in the Tuner default implementation

The current implementation does not clear the previous memcopy before
copying the next round of data into the buffer. This CL fixes the issue.

Test: atest VtsHalTvTunerV1_0TargetTest
Bug: 159027928
Change-Id: I3399c69ead046630d9c22e8fbe1e816f6ea529f9
This commit is contained in:
Amy Zhang
2020-07-30 17:24:37 -07:00
parent 6f98afcfd2
commit 990ee76d77
2 changed files with 7 additions and 1 deletions

View File

@@ -395,6 +395,7 @@ bool Dvr::processEsDataOnPlayback(bool isVirtualFrontend, bool isRecording) {
mDemux->sendFrontendInputToRecord(frameData, pid, static_cast<uint64_t>(esMeta[i].pts));
}
startFilterDispatcher(isVirtualFrontend, isRecording);
frameData.clear();
}
return true;

View File

@@ -500,7 +500,12 @@ Result Filter::startMediaFilterHandler() {
}
if (mPts) {
return createMediaFilterEventWithIon(mFilterOutput);
Result result;
result = createMediaFilterEventWithIon(mFilterOutput);
if (result == Result::SUCCESS) {
mFilterOutput.clear();
}
return result;
}
for (int i = 0; i < mFilterOutput.size(); i += 188) {