Commit d870f378 by olly Committed by Oliver Woodman

Always use same Format objects during DASH live playbacks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117558066
parent 4a38b2ca
...@@ -443,7 +443,7 @@ public class DashChunkSource implements ChunkSource { ...@@ -443,7 +443,7 @@ public class DashChunkSource implements ChunkSource {
: startingNewPeriod ? representationHolder.getFirstAvailableSegmentNum() : startingNewPeriod ? representationHolder.getFirstAvailableSegmentNum()
: queue.get(out.queueSize - 1).getNextChunkIndex(); : queue.get(out.queueSize - 1).getNextChunkIndex();
Chunk nextMediaChunk = newMediaChunk(periodHolder, representationHolder, dataSource, Chunk nextMediaChunk = newMediaChunk(periodHolder, representationHolder, dataSource,
sampleFormat, segmentNum, evaluation.trigger); selectedFormat, sampleFormat, segmentNum, evaluation.trigger);
lastChunkWasInitialization = false; lastChunkWasInitialization = false;
out.chunk = nextMediaChunk; out.chunk = nextMediaChunk;
} }
...@@ -545,8 +545,8 @@ public class DashChunkSource implements ChunkSource { ...@@ -545,8 +545,8 @@ public class DashChunkSource implements ChunkSource {
} }
protected Chunk newMediaChunk(PeriodHolder periodHolder, protected Chunk newMediaChunk(PeriodHolder periodHolder,
RepresentationHolder representationHolder, DataSource dataSource, Format sampleFormat, RepresentationHolder representationHolder, DataSource dataSource, Format trackFormat,
int segmentNum, int trigger) { Format sampleFormat, int segmentNum, int trigger) {
Representation representation = representationHolder.representation; Representation representation = representationHolder.representation;
long startTimeUs = representationHolder.getSegmentStartTimeUs(segmentNum); long startTimeUs = representationHolder.getSegmentStartTimeUs(segmentNum);
long endTimeUs = representationHolder.getSegmentEndTimeUs(segmentNum); long endTimeUs = representationHolder.getSegmentEndTimeUs(segmentNum);
...@@ -554,16 +554,15 @@ public class DashChunkSource implements ChunkSource { ...@@ -554,16 +554,15 @@ public class DashChunkSource implements ChunkSource {
DataSpec dataSpec = new DataSpec(segmentUri.getUri(), segmentUri.start, segmentUri.length, DataSpec dataSpec = new DataSpec(segmentUri.getUri(), segmentUri.start, segmentUri.length,
representation.getCacheKey()); representation.getCacheKey());
Format format = representation.format;
long sampleOffsetUs = periodHolder.startTimeUs - representation.presentationTimeOffsetUs; long sampleOffsetUs = periodHolder.startTimeUs - representation.presentationTimeOffsetUs;
if (representationHolder.extractorWrapper == null) { if (representationHolder.extractorWrapper == null) {
return new SingleSampleMediaChunk(dataSource, dataSpec, Chunk.TRIGGER_INITIAL, format, return new SingleSampleMediaChunk(dataSource, dataSpec, Chunk.TRIGGER_INITIAL, trackFormat,
startTimeUs, endTimeUs, segmentNum, format, null, periodHolder.localIndex); startTimeUs, endTimeUs, segmentNum, trackFormat, null, periodHolder.localIndex);
} else { } else {
boolean isSampleFormatFinal = sampleFormat != null; boolean isSampleFormatFinal = sampleFormat != null;
return new ContainerMediaChunk(dataSource, dataSpec, trigger, format, startTimeUs, endTimeUs, return new ContainerMediaChunk(dataSource, dataSpec, trigger, trackFormat, startTimeUs,
segmentNum, sampleOffsetUs, representationHolder.extractorWrapper, sampleFormat, endTimeUs, segmentNum, sampleOffsetUs, representationHolder.extractorWrapper,
periodHolder.drmInitData, isSampleFormatFinal, periodHolder.localIndex); sampleFormat, periodHolder.drmInitData, isSampleFormatFinal, periodHolder.localIndex);
} }
} }
......
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