mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00
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
This commit is contained in:
parent
ef728178a8
commit
450448b220
@ -140,6 +140,7 @@ import java.util.List;
|
||||
// Accessed only by the loading thread.
|
||||
private boolean tracksEnded;
|
||||
private long sampleOffsetUs;
|
||||
private int chunkUid;
|
||||
|
||||
/**
|
||||
* @param trackType The type of the track. One of the {@link C} {@code TRACK_TYPE_*} constants.
|
||||
@ -698,6 +699,7 @@ import java.util.List;
|
||||
audioSampleQueueMappingDone = false;
|
||||
videoSampleQueueMappingDone = false;
|
||||
}
|
||||
this.chunkUid = chunkUid;
|
||||
for (SampleQueue sampleQueue : sampleQueues) {
|
||||
sampleQueue.sourceId(chunkUid);
|
||||
}
|
||||
@ -752,6 +754,7 @@ import java.util.List;
|
||||
}
|
||||
}
|
||||
SampleQueue trackOutput = new SampleQueue(allocator);
|
||||
trackOutput.sourceId(chunkUid);
|
||||
trackOutput.setSampleOffsetUs(sampleOffsetUs);
|
||||
trackOutput.setUpstreamFormatChangeListener(this);
|
||||
sampleQueueTrackIds = Arrays.copyOf(sampleQueueTrackIds, trackCount + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user