Format to wake up PR

This commit is contained in:
Daniele Sparano 2023-12-05 14:57:00 +00:00 committed by tonihei
parent 4a17ca7600
commit 6f5187a34b

View File

@ -253,8 +253,7 @@ public final class H264Reader implements ElementaryStreamReader {
seiWrapper.setPosition(4); // NAL prefix and nal_unit() header. seiWrapper.setPosition(4); // NAL prefix and nal_unit() header.
seiReader.consume(pesTimeUs, seiWrapper); seiReader.consume(pesTimeUs, seiWrapper);
} }
boolean sampleIsKeyFrame = boolean sampleIsKeyFrame = sampleReader.endNalUnit(position, offset, hasOutputFormat);
sampleReader.endNalUnit(position, offset, hasOutputFormat);
if (sampleIsKeyFrame) { if (sampleIsKeyFrame) {
// This is either an IDR frame or the first I-frame since the random access indicator, so mark // This is either an IDR frame or the first I-frame since the random access indicator, so mark
// it as a keyframe. Clear the flag so that subsequent non-IDR I-frames are not marked as // it as a keyframe. Clear the flag so that subsequent non-IDR I-frames are not marked as
@ -483,8 +482,7 @@ public final class H264Reader implements ElementaryStreamReader {
isFilling = false; isFilling = false;
} }
public boolean endNalUnit( public boolean endNalUnit(long position, int offset, boolean hasOutputFormat) {
long position, int offset, boolean hasOutputFormat) {
if (nalUnitType == NalUnitUtil.NAL_UNIT_TYPE_AUD if (nalUnitType == NalUnitUtil.NAL_UNIT_TYPE_AUD
|| (detectAccessUnits && sliceHeader.isFirstVclNalUnitOfPicture(previousSliceHeader))) { || (detectAccessUnits && sliceHeader.isFirstVclNalUnitOfPicture(previousSliceHeader))) {
// If the NAL unit ending is the start of a new sample, output the previous one. // If the NAL unit ending is the start of a new sample, output the previous one.