mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
femanager: do not open unused frontends
this frees the unused frontends for e.g. vtunerd (reimplementation of8e7f2ff232
) Origin commit data ------------------ Commit:999dd041c1
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de> Date: 2013-05-25 (Sat, 25 May 2013)
This commit is contained in:
@@ -388,6 +388,7 @@ void CFEManager::linkFrontends(bool init)
|
|||||||
INFO("linking..");
|
INFO("linking..");
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
enabled_count = 0;
|
enabled_count = 0;
|
||||||
|
have_sat = have_cable = have_terr = false;
|
||||||
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
||||||
CFrontend * fe = it->second;
|
CFrontend * fe = it->second;
|
||||||
#if 0
|
#if 0
|
||||||
@@ -440,7 +441,17 @@ void CFEManager::linkFrontends(bool init)
|
|||||||
if (init && femode != CFrontend::FE_MODE_UNUSED)
|
if (init && femode != CFrontend::FE_MODE_UNUSED)
|
||||||
fe->Init();
|
fe->Init();
|
||||||
if (femode != CFrontend::FE_MODE_UNUSED)
|
if (femode != CFrontend::FE_MODE_UNUSED)
|
||||||
|
{
|
||||||
enabled_count++;
|
enabled_count++;
|
||||||
|
if (fe->isSat())
|
||||||
|
have_sat = true;
|
||||||
|
else if (fe->isCable())
|
||||||
|
have_cable = true;
|
||||||
|
else if (fe->isTerr())
|
||||||
|
have_terr = true;
|
||||||
|
}
|
||||||
|
else /* unused -> no need to keep open */
|
||||||
|
fe->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,10 +488,8 @@ void CFEManager::Open()
|
|||||||
{
|
{
|
||||||
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
||||||
CFrontend * fe = it->second;
|
CFrontend * fe = it->second;
|
||||||
if(!fe->Locked())
|
if (!fe->Locked() && fe->getMode() != CFrontend::FE_MODE_UNUSED)
|
||||||
fe->Open(true);
|
fe->Open(true);
|
||||||
if (mode == FE_MODE_SINGLE)
|
|
||||||
break; /* don't open secondary frontends if only first one is used */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -240,6 +240,8 @@ bool CFrontend::Open(bool init)
|
|||||||
|
|
||||||
void CFrontend::Init(void)
|
void CFrontend::Init(void)
|
||||||
{
|
{
|
||||||
|
/* if frontend was not enabled before, it might not be opened */
|
||||||
|
Open();
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
// Set the voltage to On, and wait voltage to become stable
|
// Set the voltage to On, and wait voltage to become stable
|
||||||
// and wait for diseqc equipment to be ready.
|
// and wait for diseqc equipment to be ready.
|
||||||
|
Reference in New Issue
Block a user