Commit 0b8724cb by olly Committed by Oliver Woodman

Fix bug where sourceId wasn't set for the first chunk

The sample queues haven't been created when the first init call
occurs. In this case we need to set sourceId when we subsequently
create the queues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204467538
parent d24e7cdf
...@@ -136,6 +136,7 @@ import java.util.Arrays; ...@@ -136,6 +136,7 @@ import java.util.Arrays;
// Accessed only by the loading thread. // Accessed only by the loading thread.
private boolean tracksEnded; private boolean tracksEnded;
private long sampleOffsetUs; private long sampleOffsetUs;
private int chunkUid;
/** /**
* @param trackType The type of the track. One of the {@link C} {@code TRACK_TYPE_*} constants. * @param trackType The type of the track. One of the {@link C} {@code TRACK_TYPE_*} constants.
...@@ -650,6 +651,7 @@ import java.util.Arrays; ...@@ -650,6 +651,7 @@ import java.util.Arrays;
audioSampleQueueMappingDone = false; audioSampleQueueMappingDone = false;
videoSampleQueueMappingDone = false; videoSampleQueueMappingDone = false;
} }
this.chunkUid = chunkUid;
for (SampleQueue sampleQueue : sampleQueues) { for (SampleQueue sampleQueue : sampleQueues) {
sampleQueue.sourceId(chunkUid); sampleQueue.sourceId(chunkUid);
} }
...@@ -704,6 +706,7 @@ import java.util.Arrays; ...@@ -704,6 +706,7 @@ import java.util.Arrays;
} }
} }
SampleQueue trackOutput = new SampleQueue(allocator); SampleQueue trackOutput = new SampleQueue(allocator);
trackOutput.sourceId(chunkUid);
trackOutput.setSampleOffsetUs(sampleOffsetUs); trackOutput.setSampleOffsetUs(sampleOffsetUs);
trackOutput.setUpstreamFormatChangeListener(this); trackOutput.setUpstreamFormatChangeListener(this);
sampleQueueTrackIds = Arrays.copyOf(sampleQueueTrackIds, trackCount + 1); sampleQueueTrackIds = Arrays.copyOf(sampleQueueTrackIds, trackCount + 1);
......
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