<html><head></head><body>ping for review.<br><br><div class="gmail_quote">于 2017年11月3日 GMT+08:00 上午9:32:26, Zhao Zhili <quinkblack@foxmail.com> 写到:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">It's supposed to return the duration of the current segment, not the<br />previous segment.<br />---<br /> modules/demux/adaptive/playlist/SegmentList.cpp | 30 <br />++++++++++++++-----------<br /> 1 file changed, 17 insertions(+), 13 deletions(-)<br /><br />diff --git a/modules/demux/adaptive/playlist/SegmentList.cpp <br />b/modules/demux/adaptive/playlist/SegmentList.cpp<br />index 59755da..415a37c 100644<br />--- a/modules/demux/adaptive/playlist/SegmentList.cpp<br />+++ b/modules/demux/adaptive/playlist/SegmentList.cpp<br />@@ -152,29 +152,33 @@ bool <br />SegmentList::getPlaybackTimeDurationBySegmentNumber(uint64_t number,<br /> if(first->getSequenceNumber() > number)<br /> return false;<br /><br />- *time = first->startTime.Get();<br />+ bool found = false;<br />+ stime_t seg_start = first->startTime.Get();<br />+ stime_t seg_dura = 0;<br /> std::vector<ISegment *>::const_iterator it = segments.begin();<br /> for(it = segments.begin(); it != segments.end(); ++it)<br /> {<br /> const ISegment *seg = *it;<br />+<br />+ if(seg->duration.Get())<br />+ seg_dura = seg->duration.Get();<br />+ else<br />+ seg_dura = duration.Get();<br />+<br /> /* Assuming there won't be any discontinuity in sequence */<br /> if(seg->getSequenceNumber() == number)<br /> {<br />+ found = true;<br /> break;<br /> }<br />- else if(seg->duration.Get())<br />- {<br />- *time += seg->duration.Get();<br />- *dur = seg->duration.Get();<br />- }<br />- else<br />- {<br />- *time += duration.Get();<br />- *dur = duration.Get();<br />- }<br />+<br />+ seg_start += seg_dura;<br /> }<br /><br />- *time = VLC_TS_0 + timescale.ToTime( *time );<br />- *dur = VLC_TS_0 + timescale.ToTime( *dur );<br />+ if(!found)<br />+ return false;<br />+<br />+ *time = VLC_TS_0 + timescale.ToTime(seg_start);<br />+ *dur = VLC_TS_0 + timescale.ToTime(seg_dura);<br /> return true;<br /> }</pre></blockquote></div><br>
-- <br>
使用 K-9 Mail 发送自我的Android设备。</body></html>