Rename flushPending() to writePendingTrackSamples()
The new name is more readable PiperOrigin-RevId: 663264188
This commit is contained in:
parent
fc18ad3135
commit
4df5ecb045
@ -130,7 +130,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
*/
|
*/
|
||||||
public void finishWritingSamplesAndFinalizeMoovBox() throws IOException {
|
public void finishWritingSamplesAndFinalizeMoovBox() throws IOException {
|
||||||
for (int i = 0; i < tracks.size(); i++) {
|
for (int i = 0; i < tracks.size(); i++) {
|
||||||
flushPending(tracks.get(i));
|
writePendingTrackSamples(tracks.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave the file empty if no samples are written.
|
// Leave the file empty if no samples are written.
|
||||||
@ -334,8 +334,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
safelyReplaceMoovAtEnd(newMoovStart, currentMoovData);
|
safelyReplaceMoovAtEnd(newMoovStart, currentMoovData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes out any pending samples to the file. */
|
/** Writes out any pending samples of the given {@link Track}. */
|
||||||
private void flushPending(Track track) throws IOException {
|
private void writePendingTrackSamples(Track track) throws IOException {
|
||||||
checkState(track.pendingSamplesByteBuffer.size() == track.pendingSamplesBufferInfo.size());
|
checkState(track.pendingSamplesByteBuffer.size() == track.pendingSamplesBufferInfo.size());
|
||||||
if (track.pendingSamplesBufferInfo.isEmpty()) {
|
if (track.pendingSamplesBufferInfo.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -417,7 +417,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
if (lastSampleInfo.presentationTimeUs - firstSampleInfo.presentationTimeUs
|
if (lastSampleInfo.presentationTimeUs - firstSampleInfo.presentationTimeUs
|
||||||
> INTERLEAVE_DURATION_US) {
|
> INTERLEAVE_DURATION_US) {
|
||||||
newSamplesWritten = true;
|
newSamplesWritten = true;
|
||||||
flushPending(track);
|
writePendingTrackSamples(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user