Add end of TS input fix to HLS mode
This commit is contained in:
parent
550bc5be20
commit
b553d2c3f9
@ -220,6 +220,7 @@ public final class H263Reader implements ElementaryStreamReader {
|
||||
public void packetFinished(boolean isEndOfInput) {
|
||||
if (isEndOfInput) {
|
||||
sampleReader.onDataEnd(totalBytesWritten, 0, hasOutputFormat);
|
||||
sampleReader.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,6 +506,7 @@ public final class H264Reader implements ElementaryStreamReader {
|
||||
// Output a final sample with the nal units currently held
|
||||
nalUnitStartPosition = position;
|
||||
outputSample(0);
|
||||
readingSample = false;
|
||||
}
|
||||
|
||||
private static final class SliceHeaderData {
|
||||
|
@ -382,6 +382,7 @@ public final class H265Reader implements ElementaryStreamReader {
|
||||
// Output a final sample with the nal units currently held
|
||||
nalUnitPosition = position;
|
||||
outputSample(0);
|
||||
readingSample = false;
|
||||
}
|
||||
|
||||
/** Returns whether a NAL unit type is one that occurs before any VCL NAL units in a sample. */
|
||||
|
@ -323,13 +323,11 @@ public final class TsExtractor implements Extractor {
|
||||
}
|
||||
|
||||
if (!fillBufferWithAtLeastOnePacket(input)) {
|
||||
if (mode != MODE_HLS) {
|
||||
// Send a dummy pusi to allow for packetFinished to be triggered on the last unit
|
||||
for (int i = 0; i < tsPayloadReaders.size(); i++) {
|
||||
TsPayloadReader payloadReader = tsPayloadReaders.valueAt(i);
|
||||
if (payloadReader instanceof PesReader) {
|
||||
payloadReader.consume(new ParsableByteArray(), FLAG_PAYLOAD_UNIT_START_INDICATOR);
|
||||
}
|
||||
// Send a dummy pusi to allow for packetFinished to be triggered on the last unit
|
||||
for (int i = 0; i < tsPayloadReaders.size(); i++) {
|
||||
TsPayloadReader payloadReader = tsPayloadReaders.valueAt(i);
|
||||
if (payloadReader instanceof PesReader) {
|
||||
payloadReader.consume(new ParsableByteArray(), FLAG_PAYLOAD_UNIT_START_INDICATOR);
|
||||
}
|
||||
}
|
||||
return RESULT_END_OF_INPUT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user