use video stc for display. make skipping look a bit better.
[enigma2.git] / lib / dvb / dvb.cpp
index b1e8ad54d96e361de1669d637eede1384d36d139..7e937e6f121cb143ad8cf031fa315d092f552bbe 100644 (file)
@@ -363,6 +363,9 @@ RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel, in
 {
        ePtr<eDVBAllocatedFrontend> fe;
 
+       if (m_cached_channel)
+               m_cached_channel=0;
+
        if (allocateFrontendByIndex(fe, frontend_index))
                return errNoFrontend;
        
@@ -377,7 +380,10 @@ RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel, in
 RESULT eDVBResourceManager::allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel)
 {
        ePtr<eDVBAllocatedDemux> demux;
-       
+
+       if (m_cached_channel)
+               m_cached_channel=0;
+
        eDVBChannel *ch;
        ch = new eDVBChannel(this, 0);
        
@@ -696,7 +702,7 @@ RESULT eDVBChannel::getLength(pts_t &len)
        return m_tstools.calcLen(len);
 }
 
-RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos)
+RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos, int mode)
 {
        if (!decoding_demux)
                return -1;
@@ -712,7 +718,8 @@ RESULT eDVBChannel::getCurrentPosition(iDVBDemux *decoding_demux, pts_t &pos)
        
        pts_t now;
        
-       r = decoding_demux->getSTC(now);
+                       /* TODO: this is a gross hack. */
+       r = decoding_demux->getSTC(now, mode ? 128 : 0);
 
        if (r)
        {
@@ -747,7 +754,7 @@ RESULT eDVBChannel::seekTo(iDVBDemux *decoding_demux, int relative, pts_t &pts)
        if (relative)
        {
                pts_t now;
-               if (getCurrentPosition(decoding_demux, now))
+               if (getCurrentPosition(decoding_demux, now, 0))
                {
                        eDebug("seekTo: getCurrentPosition failed!");
                        return -1;