[vlc-commits] DASH: unroll and clarify

Rémi Denis-Courmont git at videolan.org
Thu Apr 24 21:52:30 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 24 22:52:00 2014 +0300| [62f4aef0d55f54adbd72a78c67bffb23913257c6] | committer: Rémi Denis-Courmont

DASH: unroll and clarify

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

 modules/stream_filter/dash/mpd/SegmentTimeline.cpp |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
index 0294fe2..d6dcc38 100644
--- a/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
+++ b/modules/stream_filter/dash/mpd/SegmentTimeline.cpp
@@ -56,17 +56,16 @@ void dash::mpd::SegmentTimeline::setTimescale(int timescale)
 
 void dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element *e)
 {
-    int64_t         offset = 0;
-    for ( int i = 0; i <= e->r; ++i )
+    int64_t offset = 0;
+
+    for ( int i = 0; i < e->r; ++i )
     {
         this->elements.push_back( e );
-        if ( i < e->r )
-        {
-            e = new SegmentTimeline::Element( *e );
-            offset += e->d;
-            e->t += offset;
-        }
+        e = new SegmentTimeline::Element( *e );
+        offset += e->d;
+        e->t += offset;
     }
+    this->elements.push_back( e );
 }
 
 const SegmentTimeline::Element*    SegmentTimeline::getElement( unsigned int index ) const



More information about the vlc-commits mailing list