Commit 3a01d97a authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: add timeline seeking

Timeline was only supposed for live usage
parent 5bdf5dbd
......@@ -230,6 +230,15 @@ bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) con
if( mediaSegmentTemplate )
const uint64_t timescale = mediaSegmentTemplate->inheritTimescale();
SegmentTimeline *timeline = mediaSegmentTemplate->segmentTimeline.Get();
time = time * timescale / CLOCK_FREQ;
*ret = timeline->getElementNumberByScaledPlaybackTime(time);
return true;
const mtime_t duration = mediaSegmentTemplate->duration.Get();
*ret = mediaSegmentTemplate->startNumber.Get();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment