Commit 5b0e6934 by olly Committed by Oliver Woodman

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
parent 9bdf1ee9
......@@ -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() {
......
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 sign in to comment