X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/44e0351dc04a1f4194424eadb75ea0ef68b15628..ca329d3e86a98aacb0597d8581f5354cc99542e4:/lib/dvb/dvb.cpp diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index f2469365..11b1285a 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -312,6 +312,7 @@ RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse } m_cached_channel_state_changed_conn.disconnect(); m_cached_channel=0; + m_releaseCachedChannelTimer.stop(); } // eDebug("allocate channel.. %04x:%04x", channelid.transport_stream_id.get(), channelid.original_network_id.get()); @@ -391,8 +392,7 @@ void eDVBResourceManager::DVBChannelStateChanged(iDVBChannel *chan) void eDVBResourceManager::releaseCachedChannel() { - eDebug("release cached channel"); - m_cached_channel_state_changed_conn.disconnect(); + eDebug("release cached channel (timer timeout)"); m_cached_channel=0; } @@ -404,6 +404,7 @@ RESULT eDVBResourceManager::allocateRawChannel(eUsePtr &channel, in { m_cached_channel_state_changed_conn.disconnect(); m_cached_channel=0; + m_releaseCachedChannelTimer.stop(); } if (allocateFrontendByIndex(fe, frontend_index)) @@ -421,12 +422,6 @@ RESULT eDVBResourceManager::allocatePVRChannel(eUsePtr &channel) { ePtr demux; - if (m_cached_channel) - { - m_cached_channel_state_changed_conn.disconnect(); - m_cached_channel=0; - } - eDVBChannel *ch; ch = new eDVBChannel(this, 0); @@ -1001,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); @@ -1021,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 + ((pts_t)1)<<33 - pos; - else - pos = now - pos; + pos = now; return 0; }