another compile fix for bug #411
[enigma2.git] / lib / service / servicedvb.cpp
index 602eccfb6106348bc86dd6d20c0109bc1c3bb6bb..9f10644cec451692cf2a24fbad74606a46b16e19 100644 (file)
@@ -1391,7 +1391,7 @@ RESULT eDVBServicePlay::isCurrentlySeekable()
        if (m_decoder)
        {
                ret = (m_is_pvr || m_timeshift_active) ? 3 : 0; // fast forward/backward possible and seeking possible
-               if (m_decoder->getVideoWidth() == -1)
+               if (m_decoder->getVideoProgressive() == -1)
                        ret &= ~2;
        }
        return ret;
@@ -2089,12 +2089,13 @@ RESULT eDVBServicePlay::startTimeshift()
        return 0;
 }
 
-RESULT eDVBServicePlay::stopTimeshift()
+RESULT eDVBServicePlay::stopTimeshift(bool swToLive)
 {
        if (!m_timeshift_enabled)
                return -1;
        
-       switchToLive();
+       if (swToLive)
+               switchToLive();
        
        m_timeshift_enabled = 0;
        
@@ -2267,9 +2268,7 @@ void eDVBServicePlay::switchToLive()
        m_timeshift_active = 0;
        m_timeshift_changed = 1;
 
-       m_event((iPlayableService*)this, evSeekableStatusChanged);
-
-       updateDecoder();
+       updateDecoder(true);
 }
 
 void eDVBServicePlay::switchToTimeshift()
@@ -2299,12 +2298,10 @@ void eDVBServicePlay::switchToTimeshift()
 
        eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now.");
        pause();
-       updateDecoder(); /* mainly to switch off PCR, and to set pause */
-
-       m_event((iPlayableService*)this, evSeekableStatusChanged);
+       updateDecoder(true); /* mainly to switch off PCR, and to set pause */
 }
 
-void eDVBServicePlay::updateDecoder()
+void eDVBServicePlay::updateDecoder(bool sendSeekableStateChanged)
 {
        int vpid = -1, vpidtype = -1, pcrpid = -1, tpid = -1, achannel = -1, ac3_delay=-1, pcm_delay=-1;
        bool mustPlay = false;
@@ -2398,6 +2395,7 @@ void eDVBServicePlay::updateDecoder()
 
        if (m_decoder)
        {
+               bool wasSeekable = m_decoder->getVideoProgressive() != -1;
                if (m_dvb_service)
                {
                        achannel = m_dvb_service->getCacheEntry(eDVBService::cACHANNEL);
@@ -2472,8 +2470,13 @@ void eDVBServicePlay::updateDecoder()
                        m_dvb_service->setCacheEntry(eDVBService::cPCRPID, pcrpid);
                        m_dvb_service->setCacheEntry(eDVBService::cTPID, tpid);
                }
+               if (!sendSeekableStateChanged && (m_decoder->getVideoProgressive() != -1) != wasSeekable)
+                       sendSeekableStateChanged = true;
        }
        m_have_video_pid = (vpid > 0 && vpid < 0x2000);
+
+       if (sendSeekableStateChanged)
+               m_event((iPlayableService*)this, evSeekableStatusChanged);
 }
 
 void eDVBServicePlay::loadCuesheet()
@@ -2574,7 +2577,7 @@ void eDVBServicePlay::cutlistToCuesheet()
        {
                if (i == m_cue_entries.end())
                {
-                       if (!have_any_span)
+                       if (!have_any_span && !in)
                                break;
                        out = length;
                } else {
@@ -2604,6 +2607,7 @@ void eDVBServicePlay::cutlistToCuesheet()
                {
                        have_any_span = 1;
                        m_cue->addSourceSpan(in, out);
+                       in = out = 0;
                }
                
                in = length;