diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2010-10-11 00:03:40 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2010-10-11 00:04:12 +0200 |
| commit | 4cf4560a3dfc1a18f4bc894e153dc501965f4b0f (patch) | |
| tree | 1071871b7a0b29f623e81d880350d81c5636690f /lib/dvb/dvb.cpp | |
| parent | 006e3497641164df7a413c8730d9b8914d67e2d8 (diff) | |
| download | enigma2-4cf4560a3dfc1a18f4bc894e153dc501965f4b0f.tar.gz enigma2-4cf4560a3dfc1a18f4bc894e153dc501965f4b0f.zip | |
fix slotinfo assignment for new "unsupported tuner" handling
refs bug #587
Diffstat (limited to 'lib/dvb/dvb.cpp')
| -rw-r--r-- | lib/dvb/dvb.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 40d44186..51629452 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -320,27 +320,34 @@ PyObject *eDVBResourceManager::setFrontendSlotInformations(ePyObject list) PyErr_SetString(PyExc_StandardError, "eDVBResourceManager::setFrontendSlotInformations argument should be a python list"); return NULL; } - if ((unsigned int)PyList_Size(list) != m_frontend.size()) + unsigned int assigned=0; + for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) { + int pos=0; + while (pos < PyList_Size(list)) { + ePyObject obj = PyList_GET_ITEM(list, pos++); + if (!i->m_frontend->setSlotInfo(obj)) + continue; + ++assigned; + break; + } + } + if (assigned != m_frontend.size()) { char blasel[256]; - sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations list size incorrect %d frontends avail, but %d entries in slotlist", - m_frontend.size(), PyList_Size(list)); + sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations .. assigned %d socket informations, but %d registered frontends!", + m_frontend.size(), assigned); PyErr_SetString(PyExc_StandardError, blasel); return NULL; } - int pos=0; - for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) - { - ePyObject obj = PyList_GET_ITEM(list, pos++); - if (!i->m_frontend->setSlotInfo(obj)) - return NULL; - } - pos=0; for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_simulate_frontend.begin()); i != m_simulate_frontend.end(); ++i) { - ePyObject obj = PyList_GET_ITEM(list, pos++); - if (!i->m_frontend->setSlotInfo(obj)) - return NULL; + int pos=0; + while (pos < PyList_Size(list)) { + ePyObject obj = PyList_GET_ITEM(list, pos++); + if (!i->m_frontend->setSlotInfo(obj)) + continue; + break; + } } Py_RETURN_NONE; } |
