Commit e116125c by olly Committed by Oliver Woodman

DashChunkSource: Handle minor timing differences

Handle minor timing difference between the different media content
and the available range values as specified in the MPD.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117127112
parent c2eb9d55
...@@ -375,14 +375,20 @@ public class DashChunkSource implements ChunkSource { ...@@ -375,14 +375,20 @@ public class DashChunkSource implements ChunkSource {
// we'll need to wait until it's refreshed. If it's unbounded we just need to wait for a // we'll need to wait until it's refreshed. If it's unbounded we just need to wait for a
// while before attempting to load the chunk. // while before attempting to load the chunk.
return; return;
} else if (!currentManifest.dynamic) { } else {
// The current manifest isn't dynamic, so check whether we've reached the end of the stream. // A period's duration is the maximum of its various representation's durations, so it's
// possible that due to the minor differences between them our available range values might
// not sync exactly with the actual available content, so double check whether or not we've
// really run out of content to play.
PeriodHolder lastPeriodHolder = periodHolders.valueAt(periodHolders.size() - 1); PeriodHolder lastPeriodHolder = periodHolders.valueAt(periodHolders.size() - 1);
if (previous.parentId == lastPeriodHolder.localIndex) { if (previous.parentId == lastPeriodHolder.localIndex) {
RepresentationHolder representationHolder = RepresentationHolder representationHolder =
lastPeriodHolder.representationHolders[getTrackIndex(previous.format)]; lastPeriodHolder.representationHolders[getTrackIndex(previous.format)];
if (representationHolder.isBeyondLastSegment(previous.getNextChunkIndex())) { if (representationHolder.isBeyondLastSegment(previous.getNextChunkIndex())) {
out.endOfStream = true; if (!currentManifest.dynamic) {
// The current manifest isn't dynamic, so we've reached the end of the stream.
out.endOfStream = true;
}
return; return;
} }
} }
......
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