diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-06-08 12:01:25 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-06-08 12:01:25 +0000 |
| commit | 49fbebfa0877a8c794163b5b0fcb89fd38141c1b (patch) | |
| tree | bc91516d2c6bc86296ee30b5809cb9f1cce55c2b /lib/dvb/dvb.cpp | |
| parent | 02c6d19ed834d530384050a5831f16ec2b7aaaf0 (diff) | |
| download | enigma2-49fbebfa0877a8c794163b5b0fcb89fd38141c1b.tar.gz enigma2-49fbebfa0877a8c794163b5b0fcb89fd38141c1b.zip | |
hopefully fix "secondary cable from motorized tuner" setting
some code cleanups
now link tuners in all directions should be possible
Diffstat (limited to 'lib/dvb/dvb.cpp')
| -rw-r--r-- | lib/dvb/dvb.cpp | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 9ebe08a1..0184347b 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -255,7 +255,7 @@ void eDVBResourceManager::setFrontendSlotInformations(ePyObject list) PyErr_SetString(PyExc_StandardError, "eDVBResourceManager::setFrontendSlotInformations argument should be a python list"); return; } - if (PyList_Size(list) != m_frontend.size()) + if ((unsigned int)PyList_Size(list) != m_frontend.size()) { char blasel[256]; sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations list size incorrect %d frontends avail, but %d entries in slotlist", @@ -303,10 +303,46 @@ RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) if (!i->m_inuse && i->m_frontend->getSlotID() == slot_index) { + // check if another slot linked to this is in use + eDVBRegisteredFrontend *satpos_depends_to_fe = + (eDVBRegisteredFrontend*) i->m_frontend->m_data[eDVBFrontend::SATPOS_DEPENDS_PTR]; + if ( (int)satpos_depends_to_fe != -1 ) + { + if (satpos_depends_to_fe->m_inuse) + { + eDebug("another satpos depending frontend is in use.. so allocateFrontendByIndex not possible!"); + goto alloc_fe_by_id_not_possible; + } + } + else // check linked tuners + { + eDVBRegisteredFrontend *next = + (eDVBRegisteredFrontend *) i->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR]; + while ( (int)next != -1 ) + { + if (next->m_inuse) + { + eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!"); + goto alloc_fe_by_id_not_possible; + } + next = (eDVBRegisteredFrontend *)next->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR]; + } + eDVBRegisteredFrontend *prev = (eDVBRegisteredFrontend *) + i->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR]; + while ( (int)prev != -1 ) + { + if (prev->m_inuse) + { + eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!"); + goto alloc_fe_by_id_not_possible; + } + prev = (eDVBRegisteredFrontend *)prev->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR]; + } + } fe = new eDVBAllocatedFrontend(i); return 0; } - +alloc_fe_by_id_not_possible: fe = 0; return -1; } @@ -553,7 +589,6 @@ int eDVBResourceManager::canAllocateFrontend(ePtr<iDVBFrontendParameters> &fepar if (c > bestval) bestval = c; } - return bestval; } |
