Merge commit 'origin/bug_203_fix_wrong_networkstate' into experimental
[enigma2.git] / lib / service / servicedvb.cpp
index 1cdadcf9e1de3fe6f0101ead5452568d75870d67..c8e64b807040b3cc43430308a9e2bd4439df14b1 100644 (file)
@@ -1385,7 +1385,7 @@ RESULT eDVBServicePlay::setTrickmode(int trick)
 
 RESULT eDVBServicePlay::isCurrentlySeekable()
 {
-       return m_is_pvr || m_timeshift_active;
+       return m_is_pvr || m_timeshift_active ? 3 : 0; // fast forward/backward possible and seeking possible
 }
 
 RESULT eDVBServicePlay::frontendInfo(ePtr<iFrontendInformation> &ptr)
@@ -1743,6 +1743,7 @@ int eDVBServicePlay::selectAudioStream(int i)
 {
        eDVBServicePMTHandler::program program;
        eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler;
+       pts_t position = -1;
 
        if (h.getProgramInfo(program))
                return -1;
@@ -1765,6 +1766,9 @@ int eDVBServicePlay::selectAudioStream(int i)
                apidtype = program.audioStreams[stream].type;
        }
 
+       if (i != -1 && apid != m_current_audio_pid && (m_is_pvr || m_timeshift_active))
+               eDebug("getPlayPosition ret %d, pos %lld in selectAudioStream", getPlayPosition(position), position);
+
        m_current_audio_pid = apid;
 
        if (m_is_primary && m_decoder->setAudioPID(apid, apidtype))
@@ -1773,6 +1777,9 @@ int eDVBServicePlay::selectAudioStream(int i)
                return -4;
        }
 
+       if (position != -1)
+               eDebug("seekTo ret %d", seekTo(position));
+
        int rdsPid = apid;
 
                /* if we are not in PVR mode, timeshift is not active and we are not in pip mode, check if we need to enable the rds reader */
@@ -2278,12 +2285,13 @@ void eDVBServicePlay::switchToTimeshift()
        r.path = m_timeshift_file;
 
        m_cue = new eCueSheet();
+       m_cue->seekTo(0, -1000);
        m_service_handler_timeshift.tune(r, 1, m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
 
        eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now.");
        pause();
        updateDecoder(); /* mainly to switch off PCR, and to set pause */
-       
+
        m_event((iPlayableService*)this, evSeekableStatusChanged);
 }