Fix Tuner 1.0 default implementation Demux and Frontend mapping
The previous impl keeps the demux and frontend mapping in the
Tuner implementation even the instance has been closed.
Clean up the mapping and the local vectors in the Tuner impl
when Demux or Frontend is closed.
Test: atest VtsHalTvTunerV1_0TargetTest
Bug: 150952766
Change-Id: I2038e902ba7ab323c6dacc886ac6984ee7c475aa
diff --git a/tv/tuner/1.0/default/Demux.cpp b/tv/tuner/1.0/default/Demux.cpp
index b122a05..9055a43 100644
--- a/tv/tuner/1.0/default/Demux.cpp
+++ b/tv/tuner/1.0/default/Demux.cpp
@@ -163,6 +163,7 @@
mRecordFilterIds.clear();
mFilters.clear();
mLastUsedFilterId = -1;
+ mTunerService->removeDemux(mDemuxId);
return Result::SUCCESS;
}
@@ -318,6 +319,12 @@
std::lock_guard<std::mutex> lock(mFrontendInputThreadLock);
mFrontendInputThreadRunning = true;
+ if (!mDvrPlayback) {
+ ALOGW("[Demux] No software Frontend input configured. Ending Frontend thread loop.");
+ mFrontendInputThreadRunning = false;
+ return;
+ }
+
while (mFrontendInputThreadRunning) {
uint32_t efState = 0;
status_t status = mDvrPlayback->getDvrEventFlag()->wait(