[vlc-commits] demux: adaptive: fix computing ahead time for live templates

Francois Cartegnie git at videolan.org
Sat Jul 9 18:42:43 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Jul  2 11:10:16 2016 +0200| [2e8abf4e2700ebe11564c5643a1738e488fce914] | committer: Francois Cartegnie

demux: adaptive: fix computing ahead time for live templates

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

 modules/demux/adaptive/playlist/SegmentTemplate.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.cpp b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
index 978d86b..b9e78bb 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
@@ -101,7 +101,8 @@ stime_t MediaSegmentTemplate::getMinAheadScaledTime(uint64_t number) const
     if( segmentTimeline.Get() )
         return segmentTimeline.Get()->getMinAheadScaledTime(number);
 
-    return duration.Get(); /* FIXME: use stream end time */
+    uint64_t current = getCurrentLiveTemplateNumber();
+    return (current - number) * duration.Get();
 }
 
 uint64_t MediaSegmentTemplate::getSequenceNumber() const



More information about the vlc-commits mailing list