Commit ca51f49a authored by François Cartegnie's avatar François Cartegnie 🤞

demux: dash: enable passive seek for templates as well

parent 652977b1
......@@ -159,15 +159,29 @@ ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) co
bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) const
{
SegmentList *segList = inheritSegmentList();
if ( segList->getDuration() )
SegmentList *segList;
SegmentTemplate *segTemplate;
uint64_t timescale;
mtime_t duration = 0;
if ( (segList = inheritSegmentList()) )
{
timescale = segList->timescale.Get();
duration = segList->getDuration();
}
else if( (segTemplate = inheritSegmentTemplate(INFOTYPE_MEDIA)) )
{
timescale = segTemplate->timescale.Get();
duration = segTemplate->duration.Get();
}
if(duration)
{
uint64_t timescale = segList->timescale.Get();
if(!timescale)
timescale = getTimescale();
*ret = time / (CLOCK_FREQ * segList->getDuration() / timescale);
timescale = getTimescale(); /* inherit */
*ret = time / (CLOCK_FREQ * duration / timescale);
return true;
}
return false;
}
......
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