Commit ca51f49a authored by Francois Cartegnie's avatar Francois 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 ...@@ -159,15 +159,29 @@ ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) co
bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) const bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) const
{ {
SegmentList *segList = inheritSegmentList(); SegmentList *segList;
if ( segList->getDuration() ) 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) if(!timescale)
timescale = getTimescale(); timescale = getTimescale(); /* inherit */
*ret = time / (CLOCK_FREQ * segList->getDuration() / timescale); *ret = time / (CLOCK_FREQ * duration / timescale);
return true; return true;
} }
return false; 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