X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d1e450f95a9b79b144a00dcf0f9356ff6cb9bfb2..126bff5b5363c9769ff01c73b818cc13a04bc878:/lib/service/servicedvb.cpp diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index e47ae52c..173f471b 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -1111,7 +1111,8 @@ void eDVBServicePlay::serviceEventTimeshift(int event) m_event((iPlayableService*)this, evSOF); break; case eDVBServicePMTHandler::eventEOF: - switchToLive(); + if ((!m_is_paused) && (m_skipmode >= 0)) + switchToLive(); break; } } @@ -1151,8 +1152,6 @@ RESULT eDVBServicePlay::start() loadCuesheet(); m_event(this, evStart); } - - m_event((iPlayableService*)this, evSeekableStatusChanged); return 0; } @@ -1161,7 +1160,7 @@ RESULT eDVBServicePlay::stop() /* add bookmark for last play position */ if (m_is_pvr) { - pts_t play_position; + pts_t play_position, length; if (!getPlayPosition(play_position)) { /* remove last position */ @@ -1176,7 +1175,17 @@ RESULT eDVBServicePlay::stop() ++i; } - m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */ + if (getLength(length)) + length = 0; + + if (length) + { + int perc = play_position * 100LL / length; + + /* only store last play position when between 5% and 95% */ + if ((5 < perc) && (perc < 95)) + m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */ + } m_cuesheet_changed = 1; } } @@ -2188,8 +2197,11 @@ void eDVBServicePlay::switchToTimeshift() m_cue = new eCueSheet(); m_service_handler_timeshift.tune(r, 1, m_cue); /* use the decoder demux for everything */ - updateDecoder(); /* mainly to switch off PCR */ + eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now."); + pause(); + updateDecoder(); /* mainly to switch off PCR, and to set pause */ + m_event((iPlayableService*)this, evSeekableStatusChanged); } @@ -2336,7 +2348,10 @@ void eDVBServicePlay::updateDecoder() if (!m_is_primary) m_decoder->setTrickmode(1); - m_decoder->start(); + if (m_is_paused) + m_decoder->preroll(); + else + m_decoder->start(); if (vpid > 0 && vpid < 0x2000) ;