Remove unnecessary passing around of class variable

PiperOrigin-RevId: 599507570
This commit is contained in:
sheenachhabra 2024-01-18 07:58:44 -08:00 committed by Copybara-Service
parent 3e3c746368
commit 36e99f5264

View File

@ -164,8 +164,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
for (int i = 0; i < tracks.size(); i++) { for (int i = 0; i < tracks.size(); i++) {
Track currentTrack = tracks.get(i); Track currentTrack = tracks.get(i);
if (!currentTrack.pendingSamplesBufferInfo.isEmpty()) { if (!currentTrack.pendingSamplesBufferInfo.isEmpty()) {
List<SampleMetadata> samplesMetadata = List<SampleMetadata> samplesMetadata = processPendingSamplesBufferInfo(currentTrack);
processPendingSamplesBufferInfo(currentTrack, currentFragmentSequenceNumber);
ByteBuffer trun = Boxes.trun(samplesMetadata); ByteBuffer trun = Boxes.trun(samplesMetadata);
trafBoxes.add(Boxes.traf(Boxes.tfhd(/* trackId= */ i + 1), trun)); trafBoxes.add(Boxes.traf(Boxes.tfhd(/* trackId= */ i + 1), trun));
} }
@ -211,14 +210,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
output.position(currentPosition); output.position(currentPosition);
} }
private List<SampleMetadata> processPendingSamplesBufferInfo( private List<SampleMetadata> processPendingSamplesBufferInfo(Track track) {
Track track, int fragmentSequenceNumber) {
List<BufferInfo> sampleBufferInfos = new ArrayList<>(track.pendingSamplesBufferInfo); List<BufferInfo> sampleBufferInfos = new ArrayList<>(track.pendingSamplesBufferInfo);
List<Long> sampleDurations = List<Long> sampleDurations =
Boxes.convertPresentationTimestampsToDurationsVu( Boxes.convertPresentationTimestampsToDurationsVu(
sampleBufferInfos, sampleBufferInfos,
/* firstSamplePresentationTimeUs= */ fragmentSequenceNumber == 1 /* firstSamplePresentationTimeUs= */ currentFragmentSequenceNumber == 1
? minInputPresentationTimeUs ? minInputPresentationTimeUs
: sampleBufferInfos.get(0).presentationTimeUs, : sampleBufferInfos.get(0).presentationTimeUs,
track.videoUnitTimebase(), track.videoUnitTimebase(),