Add end of input fix to H262 reader

This commit is contained in:
Daniele Sparano 2023-06-09 17:24:16 +01:00 committed by Ian Baker
parent 45372911b0
commit 550bc5be20
2 changed files with 7 additions and 2 deletions

View File

@ -218,7 +218,11 @@ public final class H262Reader implements ElementaryStreamReader {
@Override
public void packetFinished(boolean isEndOfInput) {
// Do nothing.
if (isEndOfInput) {
@C.BufferFlags int flags = sampleIsKeyframe ? C.BUFFER_FLAG_KEY_FRAME : 0;
int size = (int) (totalBytesWritten - samplePosition);
output.sampleMetadata(sampleTimeUs, flags, size, 0, null);
}
}
/**

View File

@ -331,7 +331,8 @@ public final class TsExtractor implements Extractor {
payloadReader.consume(new ParsableByteArray(), FLAG_PAYLOAD_UNIT_START_INDICATOR);
}
}
} return RESULT_END_OF_INPUT;
}
return RESULT_END_OF_INPUT;
}
int endOfPacket = findEndOfFirstTsPacketInBuffer();