aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-04-12 19:43:16 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-04-12 19:43:16 +0000
commit05558f48586c204aab59918380ab075a42990b59 (patch)
treebc92e5c41ec792512a84b591474f4d1e8f77fe83 /lib
parent54c4c8458e71ef9630420e0dead6897165255c5b (diff)
downloadenigma2-05558f48586c204aab59918380ab075a42990b59.tar.gz
enigma2-05558f48586c204aab59918380ab075a42990b59.zip
seekAbsolute with a negative number is a seek relative to the end
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/dvb.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index ad146542..cf0bc9e2 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -847,6 +847,18 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
eDebug("seekTo: getCurrentPosition failed!");
continue;
}
+ } else if (pts < 0) /* seek relative to end */
+ {
+ pts_t len;
+ if (!getLength(len))
+ {
+ eDebug("seeking relative to end. len=%lld, seek = %lld", len, pts);
+ pts += len;
+ } else
+ {
+ eWarning("getLength failed - can't seek relative to end!");
+ continue;
+ }
}
if (relative == 1) /* pts relative */
@@ -877,7 +889,10 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
off_t offset = 0;
if (m_tstools.getOffset(offset, pts))
+ {
+ eDebug("get offset for pts=%lld failed!", pts);
continue;
+ }
eDebug("ok, resolved skip (rel: %d, diff %lld), now at %08llx", relative, pts, offset);
current_offset = offset;