mirror of
https://github.com/androidx/media.git
synced 2025-05-07 15:40:37 +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
d24e7cdffe
commit
0b8724cb66
@ -136,6 +136,7 @@ import java.util.Arrays;
|
||||
// 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.
|
||||
@ -650,6 +651,7 @@ import java.util.Arrays;
|
||||
audioSampleQueueMappingDone = false;
|
||||
videoSampleQueueMappingDone = false;
|
||||
}
|
||||
this.chunkUid = chunkUid;
|
||||
for (SampleQueue sampleQueue : sampleQueues) {
|
||||
sampleQueue.sourceId(chunkUid);
|
||||
}
|
||||
@ -704,6 +706,7 @@ import java.util.Arrays;
|
||||
}
|
||||
}
|
||||
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