summaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
authorhschang <chang@dev3>2016-12-09 02:39:48 (GMT)
committerhschang <chang@dev3>2016-12-09 02:39:48 (GMT)
commitaa69986b1b366241ec05cde4fc5532610deffcc3 (patch)
tree343401b71aacf6c9d0c22fc91511c7072531f7fc /lib/dvb
parent7b770c4d5780e873a4e36e09a30d1b552fde6ea0 (diff)
Fix TimerSanity checks for fbc tuners.
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/fbc.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/lib/dvb/fbc.cpp b/lib/dvb/fbc.cpp
index 9dd66b0..4915f92 100644
--- a/lib/dvb/fbc.cpp
+++ b/lib/dvb/fbc.cpp
@@ -82,18 +82,19 @@ eFBCTunerManager::eFBCTunerManager(ePtr<eDVBResourceManager> res_mgr)
m_instance = this;
eSmartPtrList<eDVBRegisteredFrontend> &frontends = m_res_mgr->m_frontend;
-
+ eSmartPtrList<eDVBRegisteredFrontend> &frontends_simulate = m_res_mgr->m_simulate_frontend;
/* each FBC set has 8 tuners. */
/* first set : 0, 1, 2, 3, 4, 5, 6, 7 */
/* second set : 8, 9, 10, 11, 12, 13, 14, 15 */
/* first, second frontend is top on a set */
bool isRoot;
- int fbcSetID = -1;
+ int fe_id = -1;
+ int fbcSetID = -2;
int fbcIndex = 0;
int initFbcId = -1;
int prevFbcSetID = -1;
- char tmp[128];
+ char procFileName[128];
std::string proc_fe;
bool connect_choices[32] = {false};
@@ -103,17 +104,17 @@ eFBCTunerManager::eFBCTunerManager(ePtr<eDVBResourceManager> res_mgr)
if (!(it->m_frontend->supportsDeliverySystem(SYS_DVBS, false) || it->m_frontend->supportsDeliverySystem(SYS_DVBS2, false)))
continue;
- int fe_id = feSlotID(it);
- snprintf(tmp, sizeof(tmp), "/proc/stb/frontend/%d", fe_id);
- proc_fe = tmp;
- fbcSetID = getProcData(std::string(proc_fe + "/fbc_set_id").c_str());
+ fe_id = feSlotID(it);
+ snprintf(procFileName, sizeof(procFileName), "/proc/stb/frontend/%d/fbc_set_id", fe_id);
+ fbcSetID = getProcData(procFileName);
if (fbcSetID != -1)
{
if (prevFbcSetID != fbcSetID)
{
prevFbcSetID = fbcSetID;
memset(connect_choices, 0, sizeof(connect_choices));
- loadConnectChoices(std::string(proc_fe + "/fbc_connect_choices").c_str(), connect_choices);
+ snprintf(procFileName, sizeof(procFileName), "/proc/stb/frontend/%d/fbc_connect_choices", fe_id);
+ loadConnectChoices(procFileName, connect_choices);
fbcIndex =0; // reset
}
@@ -137,6 +138,22 @@ eFBCTunerManager::eFBCTunerManager(ePtr<eDVBResourceManager> res_mgr)
fbcIndex++;
}
}
+
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(frontends_simulate.begin()); it != frontends_simulate.end(); ++it)
+ {
+ // continue for DVB-C FBC Tuner
+ if (!(it->m_frontend->supportsDeliverySystem(SYS_DVBS, false) || it->m_frontend->supportsDeliverySystem(SYS_DVBS2, false)))
+ continue;
+
+ fe_id = feSlotID(it);
+ snprintf(procFileName, sizeof(procFileName), "/proc/stb/frontend/%d/fbc_set_id", fe_id);
+ fbcSetID = getProcData(procFileName);
+ if (fbcSetID != -1)
+ {
+ /* enable fbc tuner */
+ it->m_frontend->setFBCTuner(true);
+ }
+ }
}
eFBCTunerManager::~eFBCTunerManager()