lock on pids only if video startcode is in a pes header
[enigma2.git] / lib / dvb / tstools.cpp
index 5157ef2282927a38be806229fa1a40cd1b092440..bd7ebce2843be12e4bef4d6a1f12262b47555215 100644 (file)
@@ -209,11 +209,14 @@ int eDVBTSTools::fixupPTS(const off_t &offset, pts_t &now)
        }
 }
 
-int eDVBTSTools::getOffset(off_t &offset, pts_t &pts)
+int eDVBTSTools::getOffset(off_t &offset, pts_t &pts, int marg)
 {
        if (m_use_streaminfo)
        {
-               offset = m_streaminfo.getAccessPoint(pts);
+               if (pts >= m_pts_end && marg > 0 && m_end_valid)
+                       offset = m_offset_end;
+               else
+                       offset = m_streaminfo.getAccessPoint(pts, marg);
                return 0;
        } else
        {