[vlc-commits] demux: hls: handle timescale rounding when matching segment

Francois Cartegnie git at videolan.org
Thu May 14 15:30:23 CEST 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 14 10:12:36 2020 +0200| [5318fb1fc4826fc386ee42792a152681f27ac964] | committer: Francois Cartegnie

demux: hls: handle timescale rounding when matching segment

(cherry picked from commit 570bf285289e46cf0583460bcc02a199eaa0da19)

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

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

diff --git a/modules/demux/hls/playlist/Representation.cpp b/modules/demux/hls/playlist/Representation.cpp
index 9f90d97734..1944e28e40 100644
--- a/modules/demux/hls/playlist/Representation.cpp
+++ b/modules/demux/hls/playlist/Representation.cpp
@@ -165,7 +165,8 @@ uint64_t Representation::translateSegmentNumber(uint64_t num, const SegmentInfor
     HLSSegment *fromHlsSeg = dynamic_cast<HLSSegment *>(fromSeg);
     if(!fromHlsSeg)
         return 1;
-    const mtime_t utcTime = fromHlsSeg->getUTCTime();
+    const mtime_t utcTime = fromHlsSeg->getUTCTime() +
+                               getTimescale().ToTime(fromHlsSeg->duration.Get()) / 2;
 
     std::vector<ISegment *> list;
     std::vector<ISegment *>::const_iterator it;



More information about the vlc-commits mailing list