+ takeSample(offset, p);
+ }
+ m_samples[0] = m_offset_begin;
+ m_samples[m_pts_end - m_pts_begin] = m_offset_end;
+
+// eDebug("begin, end: %llx %llx", m_offset_begin, m_offset_end);
+}
+
+ /* returns 0 when a sample was taken. */
+int eDVBTSTools::takeSample(off_t off, pts_t &p)
+{
+ if (!eDVBTSTools::getPTS(off, p, 1))
+ {
+ /* as we are happily mixing PTS and PCR values (no comment, please), we might
+ end up with some "negative" segments.
+
+ so check if this new sample is between the previous and the next field*/
+
+ std::map<pts_t, off_t>::const_iterator l = m_samples.lower_bound(p);
+ std::map<pts_t, off_t>::const_iterator u = l;
+
+ if (l != m_samples.begin())