Commit 62f4aef0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DASH: unroll and clarify

parent c4aad5aa
...@@ -56,17 +56,16 @@ void dash::mpd::SegmentTimeline::setTimescale(int timescale) ...@@ -56,17 +56,16 @@ void dash::mpd::SegmentTimeline::setTimescale(int timescale)
void dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element *e) void dash::mpd::SegmentTimeline::addElement(dash::mpd::SegmentTimeline::Element *e)
{ {
int64_t offset = 0; int64_t offset = 0;
for ( int i = 0; i <= e->r; ++i )
for ( int i = 0; i < e->r; ++i )
{ {
this->elements.push_back( e ); this->elements.push_back( e );
if ( i < e->r ) e = new SegmentTimeline::Element( *e );
{ offset += e->d;
e = new SegmentTimeline::Element( *e ); e->t += offset;
offset += e->d;
e->t += offset;
}
} }
this->elements.push_back( e );
} }
const SegmentTimeline::Element* SegmentTimeline::getElement( unsigned int index ) const const SegmentTimeline::Element* SegmentTimeline::getElement( unsigned int index ) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment