[vlc-commits] demux: dash: compute missing starttime on timeline elements
Francois Cartegnie
git at videolan.org
Mon Jan 12 20:22:07 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 8 19:12:55 2015 +0100| [f46a168af81232e67ac0f2e7366b98f1fba64244] | committer: Francois Cartegnie
demux: dash: compute missing starttime on timeline elements
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f46a168af81232e67ac0f2e7366b98f1fba64244
---
modules/demux/dash/mpd/SegmentTimeline.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/demux/dash/mpd/SegmentTimeline.cpp b/modules/demux/dash/mpd/SegmentTimeline.cpp
index 07c4dbf..540dd9c 100644
--- a/modules/demux/dash/mpd/SegmentTimeline.cpp
+++ b/modules/demux/dash/mpd/SegmentTimeline.cpp
@@ -44,7 +44,14 @@ void SegmentTimeline::addElement(mtime_t d, uint64_t r, mtime_t t)
{
Element *element = new (std::nothrow) Element(d, r, t);
if(element)
+ {
+ if(!elements.empty() && !t)
+ {
+ const Element *el = elements.back();
+ element->t = el->t + (el->d * (el->r + 1));
+ }
elements.push_back(element);
+ }
}
uint64_t SegmentTimeline::getElementNumberByScaledPlaybackTime(time_t scaled) const
More information about the vlc-commits
mailing list