[vlc-commits] demux: adaptative: fix timeline time->number

Francois Cartegnie git at videolan.org
Sat Nov 28 19:15:51 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Nov 27 22:40:50 2015 +0100| [03a564d98a4fa0b9715e30c7a0798a3dc2553302] | committer: Francois Cartegnie

demux: adaptative: fix timeline time->number

was not working with live streams as not starting from zero

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

 modules/demux/adaptative/playlist/SegmentTimeline.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/demux/adaptative/playlist/SegmentTimeline.cpp b/modules/demux/adaptative/playlist/SegmentTimeline.cpp
index 0fd3288..d931af4 100644
--- a/modules/demux/adaptative/playlist/SegmentTimeline.cpp
+++ b/modules/demux/adaptative/playlist/SegmentTimeline.cpp
@@ -90,6 +90,9 @@ uint64_t SegmentTimeline::getElementNumberByScaledPlaybackTime(stime_t scaled) c
     for(it = elements.begin(); it != elements.end(); ++it)
     {
         const Element *el = *it;
+        if(it == elements.begin())
+            scaled -= el->t;
+
         for(uint64_t repeat = 1 + el->r; repeat; repeat--)
         {
             if(el->d >= scaled)



More information about the vlc-commits mailing list