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

Francois Cartegnie git at videolan.org
Thu May 14 10:18:52 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 14 10:12:36 2020 +0200| [570bf285289e46cf0583460bcc02a199eaa0da19] | committer: Francois Cartegnie

demux: hls: handle timescale rounding when matching segment

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

 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 22e78fb6a8..db669d25ff 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 vlc_tick_t utcTime = fromHlsSeg->getUTCTime();
+    const vlc_tick_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