From: Felix Domke Date: Thu, 12 Apr 2007 19:43:16 +0000 (+0000) Subject: seekAbsolute with a negative number is a seek relative to the end X-Git-Tag: 2.6.0~2320 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/05558f48586c204aab59918380ab075a42990b59 seekAbsolute with a negative number is a seek relative to the end --- 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;