X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/be7160f4c15f23e853a3a0ad7b0ad54107ed9ca1..a9fc8426e77d7e07cbbfdc4fc5a9aec211134d7c:/lib/dvb/dvb.cpp diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 6e87585e..4a6da016 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -248,12 +248,12 @@ void eDVBResourceManager::addAdapter(iDVBAdapter *adapter) } } -void eDVBResourceManager::setFrontendSlotInformations(ePyObject list) +PyObject *eDVBResourceManager::setFrontendSlotInformations(ePyObject list) { if (!PyList_Check(list)) { PyErr_SetString(PyExc_StandardError, "eDVBResourceManager::setFrontendSlotInformations argument should be a python list"); - return; + return NULL; } if ((unsigned int)PyList_Size(list) != m_frontend.size()) { @@ -261,14 +261,16 @@ void eDVBResourceManager::setFrontendSlotInformations(ePyObject list) sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations list size incorrect %d frontends avail, but %d entries in slotlist", m_frontend.size(), PyList_Size(list)); PyErr_SetString(PyExc_StandardError, blasel); - return; + return NULL; } int pos=0; for (eSmartPtrList::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) { ePyObject obj = PyList_GET_ITEM(list, pos++); - i->m_frontend->setSlotInfo(obj); + if (!i->m_frontend->setSlotInfo(obj)) + return NULL; } + Py_RETURN_NONE; } RESULT eDVBResourceManager::allocateFrontend(ePtr &fe, ePtr &feparm) @@ -1057,7 +1059,7 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off pts_t nextap; if (m_tstools.getNextAccessPoint(nextap, now, pts)) { - pts = now; + pts = now - 90000; /* approx. 1s */ eDebug("AP relative seeking failed!"); } else { @@ -1102,7 +1104,7 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off { /* in normal playback, just start at the next zone. */ start = i->first; - + /* size is not 64bit! */ if ((i->second - i->first) > max) size = max; @@ -1123,8 +1125,11 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off --i; eDebug("skip to previous block, which is %llx..%llx", i->first, i->second); size_t len; - - if ((i->second - i->first) > max) + + aligned_start = align(i->first, blocksize); + aligned_end = align(i->second, blocksize); + + if ((aligned_end - aligned_start) > max) len = max; else len = aligned_end - aligned_start; @@ -1132,19 +1137,19 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off start = aligned_end - len; eDebug("skipping to %llx, %d", start, len); } - + eDebug("result: %llx, %x (%llx %llx)", start, size, aligned_start, aligned_end); return; } } - + if ((current_offset < -m_skipmode_m) && (m_skipmode_m < 0)) { eDebug("reached SOF"); m_skipmode_m = 0; m_pvr_thread->sendEvent(eFilePushThread::evtUser); } - + start = current_offset; size = max;