diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-13 04:28:50 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-13 04:28:50 +0000 |
| commit | a1579bb7cb05ea1265204103b2dd4007c8f817c5 (patch) | |
| tree | aa538637cabf928d6103eb817719baa92156100e /lib | |
| parent | 6d2e4a11c8c6ac882edfaee16fe9036955150ad0 (diff) | |
| download | enigma2-a1579bb7cb05ea1265204103b2dd4007c8f817c5.tar.gz enigma2-a1579bb7cb05ea1265204103b2dd4007c8f817c5.zip | |
add seekToPosition to DVBChannel
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dvb/dvb.cpp | 21 | ||||
| -rw-r--r-- | lib/dvb/dvb.h | 1 | ||||
| -rw-r--r-- | lib/dvb/idvb.h | 3 |
3 files changed, 22 insertions, 3 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 13ae224c..a2a37758 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -619,11 +619,30 @@ RESULT eDVBChannel::getCurrentPosition(pts_t &pos) RESULT eDVBChannel::seekTo(pts_t &pts) { +#if 0 + eDebug("eDVBChannel: seekTo .. %llx", pts); m_pvr_thread->pause(); if (m_decoder_demux) m_decoder_demux->get().flush(); /* demux will also flush all decoder.. */ -// m_pvr_thread->seek(pts); + + off_t r; + + if (!m_tstools.getPosition(pts, r)); + m_pvr_thread->seek(r); + else + eDebug("getPosition failed!"); m_pvr_thread->resume(); +#endif } +RESULT eDVBChannel::seekToPosition(int relative, const off_t &r) +{ + eDebug("eDVBChannel: seekToPosition .. %llx", r); + m_pvr_thread->pause(); + if (m_decoder_demux) + m_decoder_demux->get().flush(); + /* demux will also flush all decoder.. */ + m_pvr_thread->seek(relative ? SEEK_CUR : SEEK_SET, r); + m_pvr_thread->resume(); +} diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index f8586257..01a0e47e 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -193,6 +193,7 @@ public: RESULT getLength(pts_t &len); RESULT getCurrentPosition(pts_t &pos); RESULT seekTo(pts_t &pts); + RESULT seekToPosition(int relative, const off_t &off); private: ePtr<eDVBAllocatedFrontend> m_frontend; diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index bd528f06..de481d7f 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -481,8 +481,7 @@ public: virtual RESULT getLength(pts_t &pts) = 0; virtual RESULT getCurrentPosition(pts_t &pos) = 0; virtual RESULT seekTo(pts_t &pts) = 0; - - // seekTo ... + virtual RESULT seekToPosition(int relative, const off_t &pts) = 0; }; class iDVBSectionReader; |
