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

Francois Cartegnie git at videolan.org
Mon Mar 30 16:16:38 CEST 2020


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

demux: adaptive: fix live template period offset

(cherry picked from commit 8587d8387777809f673a41d6acd1d479296112c2)

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

 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 43e3b83c61..4989dec10c 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
@@ -158,9 +158,10 @@ uint64_t MediaSegmentTemplate::getLiveTemplateNumber(mtime_t playbacktime) const
     {
         /* compute, based on current time */
         const Timescale timescale = inheritTimescale();
-        time_t streamstart = parentSegmentInformation->getPlaylist()->availabilityStartTime.Get();
+        mtime_t streamstart = CLOCK_FREQ *
+                parentSegmentInformation->getPlaylist()->availabilityStartTime.Get();
         streamstart += parentSegmentInformation->getPeriodStart();
-        stime_t elapsed = timescale.ToScaled(playbacktime - streamstart * CLOCK_FREQ);
+        stime_t elapsed = timescale.ToScaled(playbacktime - streamstart);
         number += elapsed / dur;
     }
 



More information about the vlc-commits mailing list