diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-02-15 01:20:15 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-02-15 01:20:15 +0000 |
| commit | ca329d3e86a98aacb0597d8581f5354cc99542e4 (patch) | |
| tree | 9245b99c8971d7ae0c50ea8cc5d09608599fc6b3 /lib/dvb/dvb.cpp | |
| parent | b62474db510d8ffea6d3501bdb6f96a0cb15d180 (diff) | |
| download | enigma2-ca329d3e86a98aacb0597d8581f5354cc99542e4.tar.gz enigma2-ca329d3e86a98aacb0597d8581f5354cc99542e4.zip | |
use cached pts/offsets when available, clean up
Diffstat (limited to 'lib/dvb/dvb.cpp')
| -rw-r--r-- | lib/dvb/dvb.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index ad865c08..11b1285a 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -996,17 +996,8 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, in if (!decoding_demux) return -1; - off_t begin = 0; - /* getPTS for offset 0 is cached, so it doesn't harm. */ - int r = m_tstools.getPTS(begin, pos); - if (r) - { - eDebug("tstools getpts(0) failed!"); - return r; - } - pts_t now; - + int r; /* TODO: this is a gross hack. */ r = decoding_demux->getSTC(now, mode ? 128 : 0); @@ -1016,19 +1007,15 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, in return -1; } -// eDebug("STC: %08llx PTS: %08llx, diff %lld", now, pos, now - pos); - /* when we are less than 10 seconds before the start, return 0. */ - /* (we're just waiting for the timespam to start) */ - if ((now < pos) && ((pos - now) < 90000 * 10)) + off_t off = 0; /* TODO: fixme */ + r = m_tstools.fixupPTS(off, now); + if (r) { - pos = 0; - return 0; + eDebug("fixup PTS failed"); + return -1; } - if (now < pos) /* wrap around */ - pos = now + 0x200000000LL - pos; - else - pos = now - pos; + pos = now; return 0; } |
