[vlc-commits] demux: adaptive: fix live template period offset

Francois Cartegnie git at videolan.org
Tue Mar 17 12:42:23 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 16 09:33:00 2020 +0100| [8587d8387777809f673a41d6acd1d479296112c2] | committer: Francois Cartegnie

demux: adaptive: fix live template period offset

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

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

diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.cpp b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
index eddf971822..458c9668de 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
@@ -157,9 +157,10 @@ uint64_t MediaSegmentTemplate::getLiveTemplateNumber(vlc_tick_t playbacktime) co
     {
         /* compute, based on current time */
         const Timescale timescale = inheritTimescale();
-        time_t streamstart = parentSegmentInformation->getPlaylist()->availabilityStartTime.Get();
+        vlc_tick_t streamstart =
+                vlc_tick_from_sec(parentSegmentInformation->getPlaylist()->availabilityStartTime.Get());
         streamstart += parentSegmentInformation->getPeriodStart();
-        stime_t elapsed = timescale.ToScaled(playbacktime - vlc_tick_from_sec(streamstart));
+        stime_t elapsed = timescale.ToScaled(playbacktime - streamstart);
         number += elapsed / dur;
     }
 



More information about the vlc-commits mailing list