[vlc-commits] demux: adaptive: fix timeline timescale regression
Francois Cartegnie
git at videolan.org
Fri May 17 16:08:18 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 17 15:32:38 2019 +0200| [1245b3ae7642435632cdb8eff1a35f012900ea5d] | committer: Francois Cartegnie
demux: adaptive: fix timeline timescale regression
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1245b3ae7642435632cdb8eff1a35f012900ea5d
---
modules/demux/adaptive/playlist/SegmentInformation.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptive/playlist/SegmentInformation.cpp b/modules/demux/adaptive/playlist/SegmentInformation.cpp
index d39a55ee49..82424e1ffc 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.cpp
@@ -347,11 +347,12 @@ bool SegmentInformation::getSegmentNumberByTime(vlc_tick_t time, uint64_t *ret)
{
if( mediaSegmentTemplate )
{
- const Timescale timescale = mediaSegmentTemplate->inheritTimescale();
-
const SegmentTimeline *timeline = mediaSegmentTemplate->inheritSegmentTimeline();
if(timeline)
{
+ const Timescale timescale = timeline->getTimescale().isValid()
+ ? timeline->getTimescale()
+ : mediaSegmentTemplate->inheritTimescale();
stime_t st = timescale.ToScaled(time);
*ret = timeline->getElementNumberByScaledPlaybackTime(st);
return true;
@@ -366,6 +367,7 @@ bool SegmentInformation::getSegmentNumberByTime(vlc_tick_t time, uint64_t *ret)
}
else
{
+ const Timescale timescale = mediaSegmentTemplate->inheritTimescale();
*ret = mediaSegmentTemplate->inheritStartNumber();
*ret += timescale.ToScaled(time) / duration;
}
More information about the vlc-commits
mailing list