Fix DefaultDashChunkSource.updateLiveEdgeTimeUs

Very subtle, but lastAvailableSegmentNum is shifted by
RepresentationHolder.segmentNumShift. When accessing the
index directly it's necessary to unshift. The easiest way
to do this is to call through the holder, which does this
for you.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169239928
This commit is contained in:
olly 2017-09-19 07:44:46 -07:00 committed by Oliver Woodman
parent 9bdf1ee944
commit 5b0e693419

View file

@ -317,15 +317,8 @@ public class DefaultDashChunkSource implements DashChunkSource {
private void updateLiveEdgeTimeUs(RepresentationHolder representationHolder,
int lastAvailableSegmentNum) {
if (manifest.dynamic) {
DashSegmentIndex segmentIndex = representationHolder.representation.getIndex();
long lastSegmentDurationUs = segmentIndex.getDurationUs(lastAvailableSegmentNum,
manifest.getPeriodDurationUs(periodIndex));
liveEdgeTimeUs = segmentIndex.getTimeUs(lastAvailableSegmentNum)
+ lastSegmentDurationUs;
} else {
liveEdgeTimeUs = C.TIME_UNSET;
}
liveEdgeTimeUs = manifest.dynamic
? representationHolder.getSegmentEndTimeUs(lastAvailableSegmentNum) : C.TIME_UNSET;
}
private long getNowUnixTimeUs() {