aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/dvb.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-02-13 03:41:57 +0100
committerFelix Domke <tmbinc@elitedvb.net>2009-02-13 03:41:57 +0100
commitdce87891f204f8e1f7151c4a3ba00b9dd048e795 (patch)
treef90c93d185e897b73307a0ead1ee88fa75e02453 /lib/dvb/dvb.cpp
parent979cdde152f5998de6593f1d3b6998bb224d5c97 (diff)
downloadenigma2-dce87891f204f8e1f7151c4a3ba00b9dd048e795.tar.gz
enigma2-dce87891f204f8e1f7151c4a3ba00b9dd048e795.zip
- While recording, collect startcodes and save them into ".sc"-files
- this allows finding iframes for fast forward/reverse more easily - when in fast forward, strictly just output good (=complete iframes) data (this might break dm7025, we will fix this later) - draw smaller, fixed-size bar in position gauge
Diffstat (limited to 'lib/dvb/dvb.cpp')
-rw-r--r--lib/dvb/dvb.cpp56
1 files changed, 34 insertions, 22 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index c320fc78..4bbed519 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -974,7 +974,7 @@ int eDVBChannelFilePush::filterRecordData(const unsigned char *_data, int len, s
}
#endif
-#if 1 /* This codepath is required on Broadcom-based Dreamboxes (DM800, DM8000) and strips away non-I-frames. */
+#if 0
if (!m_iframe_search)
return len;
@@ -1272,6 +1272,21 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
eDebug("getNextSourceSpan, current offset is %08llx, m_skipmode_m = %d!", current_offset, m_skipmode_m);
current_offset += align(m_skipmode_m, blocksize);
+
+ if (m_skipmode_m)
+ {
+ eDebug("we are at %llx, and we try to find the iframe here:", current_offset);
+ size_t iframe_len;
+ off_t iframe_start = current_offset;
+
+ if (m_tstools.findIFrame(iframe_start, iframe_len, (m_skipmode_m < 0) ? -1 : +1))
+ eDebug("failed");
+ else
+ {
+ current_offset = align(iframe_start, blocksize);
+ max = align(iframe_len, blocksize);
+ }
+ }
while (!m_cue->m_seek_requests.empty())
{
@@ -1348,6 +1363,10 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
eDebug("get offset for pts=%lld failed!", pts);
continue;
}
+
+ size_t iframe_len;
+ /* try to align to iframe */
+ m_tstools.findIFrame(offset, iframe_len, pts < 0 ? -1 : 1);
eDebug("ok, resolved skip (rel: %d, diff %lld), now at %08llx", relative, pts, offset);
current_offset = align(offset, blocksize); /* in case tstools return non-aligned offset */
@@ -1417,30 +1436,23 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
}
}
- if (m_source_span.empty()) {
- if ((current_offset < -m_skipmode_m) && (m_skipmode_m < 0))
- {
- eDebug("reached SOF");
- m_skipmode_m = 0;
- m_pvr_thread->sendEvent(eFilePushThread::evtUser);
- }
+ if ((current_offset < -m_skipmode_m) && (m_skipmode_m < 0))
+ {
+ eDebug("reached SOF");
+ m_skipmode_m = 0;
+ m_pvr_thread->sendEvent(eFilePushThread::evtUser);
+ }
+
+ if (m_source_span.empty())
+ {
start = current_offset;
size = max;
- } else {
- off_t tmp2, tmp = align(m_source_span.rbegin()->second, blocksize);
- pts_t len;
- getLength(len);
- m_tstools.getOffset(tmp2, len, 1);
- if (current_offset == tmp || current_offset == tmp2) {
- start = tmp2;
- size = max;
- } else {
- start = tmp - align(512*1024, blocksize);
- size = align(512*1024, blocksize);
- }
+ eDebug("NO CUESHEET. (%08llx, %d)", start, size);
+ } else
+ {
+ start = current_offset;
+ size = 0;
}
-
- eDebug("END OF CUESHEET. (%08llx, %d)", start, size);
return;
}