diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 7cf4fa47a..1dc4fd0bb 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -388,6 +388,7 @@ void CFEManager::linkFrontends(bool init) INFO("linking.."); OpenThreads::ScopedLock m_lock(mutex); enabled_count = 0; + have_sat = have_cable = have_terr = false; for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) { CFrontend * fe = it->second; #if 0 @@ -440,7 +441,17 @@ void CFEManager::linkFrontends(bool init) if (init && femode != CFrontend::FE_MODE_UNUSED) fe->Init(); if (femode != CFrontend::FE_MODE_UNUSED) + { 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++) { CFrontend * fe = it->second; - if(!fe->Locked()) + if (!fe->Locked() && fe->getMode() != CFrontend::FE_MODE_UNUSED) fe->Open(true); - if (mode == FE_MODE_SINGLE) - break; /* don't open secondary frontends if only first one is used */ } } diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index e1ed7a5fe..750d05683 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -240,6 +240,8 @@ bool CFrontend::Open(bool init) void CFrontend::Init(void) { + /* if frontend was not enabled before, it might not be opened */ + Open(); mutex.lock(); // Set the voltage to On, and wait voltage to become stable // and wait for diseqc equipment to be ready.