Merge branch 'bug_411_timeshift_disable_without_live'
[vuplus_dvbapp] / lib / service / servicedvb.cpp
index c7bb5d9..558bf0c 100644 (file)
@@ -1128,11 +1128,7 @@ RESULT eDVBServicePlay::stop()
                        
                        if (length)
                        {
-                               int perc = play_position * 100LL / length;
-                       
-                                       /* only store last play position when between 1% and 99% */
-                               if ((1 < perc) && (perc < 99))
-                                       m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */
+                               m_cue_entries.insert(cueEntry(play_position, 3)); /* last play position */
                        }
                        m_cuesheet_changed = 1;
                }
@@ -2089,12 +2085,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;
        
@@ -2576,7 +2573,7 @@ void eDVBServicePlay::cutlistToCuesheet()
        {
                if (i == m_cue_entries.end())
                {
-                       if (!have_any_span)
+                       if (!have_any_span && !in)
                                break;
                        out = length;
                } else {
@@ -2606,6 +2603,7 @@ void eDVBServicePlay::cutlistToCuesheet()
                {
                        have_any_span = 1;
                        m_cue->addSourceSpan(in, out);
+                       in = out = 0;
                }
                
                in = length;