+ /* search entry before and after */
+ std::map<pts_t, off_t>::const_iterator l = m_samples.lower_bound(pts);
+ std::map<pts_t, off_t>::const_iterator u = l;
+
+ if (l != m_samples.begin())
+ --l;
+
+ /* we could have seeked beyond the end */
+ if (u == m_samples.end())
+ {
+ /* use last segment for interpolation. */
+ if (l != m_samples.begin())
+ {
+ --u;
+ --l;
+ }
+ }
+