From: Felix Domke Date: Sun, 13 Nov 2005 04:28:50 +0000 (+0000) Subject: add seekToPosition to DVBChannel X-Git-Tag: 2.6.0~5276 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/a1579bb7cb05ea1265204103b2dd4007c8f817c5?hp=6d2e4a11c8c6ac882edfaee16fe9036955150ad0;ds=sidebyside add seekToPosition to DVBChannel --- 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 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;