[vlc-commits] demux: adaptive: add missing number/time mapping for segmentbase

Francois Cartegnie git at videolan.org
Fri Jun 10 16:07:22 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun  9 12:07:44 2016 +0200| [13b507474d3763e93e8f96f235a70fdcb2b21ed9] | committer: Francois Cartegnie

demux: adaptive: add missing number/time mapping for segmentbase

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13b507474d3763e93e8f96f235a70fdcb2b21ed9
---

 modules/demux/adaptive/playlist/SegmentInformation.cpp |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/demux/adaptive/playlist/SegmentInformation.cpp b/modules/demux/adaptive/playlist/SegmentInformation.cpp
index 51e33a0..b942d59 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.cpp
@@ -357,6 +357,17 @@ bool SegmentInformation::getPlaybackTimeDurationBySegmentNumber(uint64_t number,
     {
         return segList->getPlaybackTimeDurationBySegmentNumber(number, time, duration);
     }
+    else
+    {
+        const uint64_t timescale = inheritTimescale();
+        const ISegment *segment = getSegment(SegmentInfoType::INFOTYPE_MEDIA, number);
+        if( segment )
+        {
+            *time = segment->startTime.Get() * CLOCK_FREQ / timescale;
+            *duration = segment->duration.Get() * CLOCK_FREQ / timescale;
+            return true;
+        }
+    }
 
     return false;
 }



More information about the vlc-commits mailing list