[vlc-commits] demux: dash: check template seek range
Francois Cartegnie
git at videolan.org
Thu Apr 2 17:48:48 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 2 17:05:29 2020 +0200| [81a647db67ddd2a0052b5f28c58c8a24f7f2c4db] | committer: Francois Cartegnie
demux: dash: check template seek range
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81a647db67ddd2a0052b5f28c58c8a24f7f2c4db
---
modules/demux/adaptive/playlist/SegmentInformation.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/modules/demux/adaptive/playlist/SegmentInformation.cpp b/modules/demux/adaptive/playlist/SegmentInformation.cpp
index adbead58f1..33057957cc 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.cpp
@@ -329,7 +329,15 @@ bool SegmentInformation::getSegmentNumberByTime(vlc_tick_t time, uint64_t *ret)
{
if( getPlaylist()->isLive() )
{
- *ret = mediaSegmentTemplate->getLiveTemplateNumber(time, false);
+ vlc_tick_t now = vlc_tick_from_sec(::time(NULL));
+ if(getPlaylist()->availabilityStartTime.Get())
+ {
+ if(time >= getPlaylist()->availabilityStartTime.Get() && time < now)
+ *ret = mediaSegmentTemplate->getLiveTemplateNumber(time, true);
+ else if(now - getPlaylist()->availabilityStartTime.Get() > now)
+ *ret = mediaSegmentTemplate->getLiveTemplateNumber(time, false);
+ }
+ else return false;
}
else
{
More information about the vlc-commits
mailing list