[vlc-commits] demux: dash: fix templated live stream playback (fix #16958)
Francois Cartegnie
git at videolan.org
Sun May 15 21:16:53 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun May 15 21:14:36 2016 +0200| [47d84735c25a2ecd56ab49a293554da68ef970c7] | committer: Francois Cartegnie
demux: dash: fix templated live stream playback (fix #16958)
another hls change breaking dash.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47d84735c25a2ecd56ab49a293554da68ef970c7
---
modules/demux/adaptive/playlist/BaseRepresentation.cpp | 9 ++++++---
modules/demux/adaptive/playlist/SegmentTemplate.cpp | 8 ++++++++
modules/demux/adaptive/playlist/SegmentTemplate.h | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/modules/demux/adaptive/playlist/BaseRepresentation.cpp b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
index 9823377..36e09d2 100644
--- a/modules/demux/adaptive/playlist/BaseRepresentation.cpp
+++ b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
@@ -108,12 +108,15 @@ mtime_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
if(seglist.size() == 1 && seglist.front()->isTemplate())
{
const MediaSegmentTemplate *templ = dynamic_cast<MediaSegmentTemplate *>(seglist.front());
- const SegmentTimeline *timeline;
- if(templ && (timeline = templ->segmentTimeline.Get()))
+ if(templ)
{
const uint64_t timescale = templ->inheritTimescale();
- return timeline->getMinAheadScaledTime(curnum) * CLOCK_FREQ / timescale;
+ stime_t i_length = templ->getMinAheadScaledTime(curnum);
+ return i_length * CLOCK_FREQ / timescale;
}
+
+ /* should not happen */
+ return CLOCK_FREQ;
}
mtime_t minTime = 0;
diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.cpp b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
index 0521fa4..9fc9fbc 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
@@ -75,6 +75,14 @@ size_t MediaSegmentTemplate::pruneBySequenceNumber(uint64_t number)
return 0;
}
+stime_t MediaSegmentTemplate::getMinAheadScaledTime(uint64_t number) const
+{
+ if( segmentTimeline.Get() )
+ return segmentTimeline.Get()->getMinAheadScaledTime(number);
+
+ return duration.Get(); /* FIXME: use stream end time */
+}
+
uint64_t MediaSegmentTemplate::getSequenceNumber() const
{
return startNumber.Get();
diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.h b/modules/demux/adaptive/playlist/SegmentTemplate.h
index e1958a9..c94f961 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.h
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.h
@@ -52,6 +52,7 @@ namespace adaptive
virtual void setSourceUrl( const std::string &url ); /* reimpl */
void mergeWith( MediaSegmentTemplate *, mtime_t );
virtual uint64_t getSequenceNumber() const; /* reimpl */
+ stime_t getMinAheadScaledTime(uint64_t) const;
void pruneByPlaybackTime(mtime_t);
size_t pruneBySequenceNumber(uint64_t);
virtual void debug(vlc_object_t *, int = 0) const; /* reimpl */
More information about the vlc-commits
mailing list