Commit 37e00c8c by olly Committed by Oliver Woodman

Support multiplexed fMP4.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117228173
parent c08c5b6f
...@@ -50,20 +50,18 @@ public final class ChunkIndex implements SeekMap { ...@@ -50,20 +50,18 @@ public final class ChunkIndex implements SeekMap {
private final long durationUs; private final long durationUs;
/** /**
* @param durationUs The duration of the stream.
* @param sizes The chunk sizes, in bytes. * @param sizes The chunk sizes, in bytes.
* @param offsets The chunk byte offsets. * @param offsets The chunk byte offsets.
* @param durationsUs The chunk durations, in microseconds. * @param durationsUs The chunk durations, in microseconds.
* @param timesUs The start time of each chunk, in microseconds. * @param timesUs The start time of each chunk, in microseconds.
*/ */
public ChunkIndex(long durationUs, int[] sizes, long[] offsets, long[] durationsUs, public ChunkIndex(int[] sizes, long[] offsets, long[] durationsUs, long[] timesUs) {
long[] timesUs) {
this.durationUs = durationUs;
this.sizes = sizes; this.sizes = sizes;
this.offsets = offsets; this.offsets = offsets;
this.durationsUs = durationsUs; this.durationsUs = durationsUs;
this.timesUs = timesUs; this.timesUs = timesUs;
length = sizes.length; length = sizes.length;
durationUs = durationsUs[length - 1] + timesUs[length - 1];
} }
/** /**
......
...@@ -338,9 +338,8 @@ public class SmoothStreamingChunkSource implements ChunkSource { ...@@ -338,9 +338,8 @@ public class SmoothStreamingChunkSource implements ChunkSource {
Track track = new Track(j, streamElementType, timescale, C.UNKNOWN_TIME_US, durationUs, Track track = new Track(j, streamElementType, timescale, C.UNKNOWN_TIME_US, durationUs,
formats[j], trackEncryptionBoxes, nalUnitLengthFieldLength, null, null); formats[j], trackEncryptionBoxes, nalUnitLengthFieldLength, null, null);
FragmentedMp4Extractor extractor = new FragmentedMp4Extractor( FragmentedMp4Extractor extractor = new FragmentedMp4Extractor(
FragmentedMp4Extractor.WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME
| FragmentedMp4Extractor.WORKAROUND_IGNORE_TFDT_BOX); | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX, track);
extractor.setTrack(track);
extractorWrappers[j] = new ChunkExtractorWrapper(extractor); extractorWrappers[j] = new ChunkExtractorWrapper(extractor);
} }
elementIndex = i; elementIndex = i;
......
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