diff options
Diffstat (limited to 'MPD/SegmentListStream.cpp')
-rw-r--r-- | MPD/SegmentListStream.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/MPD/SegmentListStream.cpp b/MPD/SegmentListStream.cpp index c3530086..86d36e68 100644 --- a/MPD/SegmentListStream.cpp +++ b/MPD/SegmentListStream.cpp @@ -53,11 +53,15 @@ ISegment* SegmentListStream::getIndexSegment(size_t segmentNumber) return NULL; } -ISegment* SegmentListStream::getMediaSegment(size_t segmentNumber) +ISegment* SegmentListStream::getMediaSegment(size_t segmentNumber, uint64_t& segmentDuration) { if (this->segmentList->GetSegmentURLs().size() > segmentNumber) + { + uint32_t duration = representation->GetSegmentList()->GetDuration(); + uint32_t timescale = representation->GetSegmentList()->GetTimescale(); + segmentDuration = (uint64_t)(((float)duration/(float)timescale) * 1000); return this->segmentList->GetSegmentURLs().at(segmentNumber)->ToMediaSegment(this->baseUrls); - + } return NULL; } @@ -93,6 +97,11 @@ ISegmentList* SegmentListStream::findSegmentList() return NULL; } +uint32_t SegmentListStream::getTimescale () +{ + return this->segmentList->GetTimescale(); +} + uint32_t SegmentListStream::getAverageSegmentDuration() { /* TODO calculate average segment durations for SegmentTimeline */ |