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) {
|
public void packetFinished(boolean isEndOfInput) {
|
||||||
if (isEndOfInput) {
|
if (isEndOfInput) {
|
||||||
sampleReader.onDataEnd(totalBytesWritten, 0, hasOutputFormat);
|
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
|
// Output a final sample with the nal units currently held
|
||||||
nalUnitStartPosition = position;
|
nalUnitStartPosition = position;
|
||||||
outputSample(0);
|
outputSample(0);
|
||||||
|
readingSample = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class SliceHeaderData {
|
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
|
// Output a final sample with the nal units currently held
|
||||||
nalUnitPosition = position;
|
nalUnitPosition = position;
|
||||||
outputSample(0);
|
outputSample(0);
|
||||||
|
readingSample = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns whether a NAL unit type is one that occurs before any VCL NAL units in a sample. */
|
/** Returns whether a NAL unit type is one that occurs before any VCL NAL units in a sample. */
|
||||||
|
@ -323,7 +323,6 @@ public final class TsExtractor implements Extractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!fillBufferWithAtLeastOnePacket(input)) {
|
if (!fillBufferWithAtLeastOnePacket(input)) {
|
||||||
if (mode != MODE_HLS) {
|
|
||||||
// Send a dummy pusi to allow for packetFinished to be triggered on the last unit
|
// Send a dummy pusi to allow for packetFinished to be triggered on the last unit
|
||||||
for (int i = 0; i < tsPayloadReaders.size(); i++) {
|
for (int i = 0; i < tsPayloadReaders.size(); i++) {
|
||||||
TsPayloadReader payloadReader = tsPayloadReaders.valueAt(i);
|
TsPayloadReader payloadReader = tsPayloadReaders.valueAt(i);
|
||||||
@ -331,7 +330,6 @@ public final class TsExtractor implements Extractor {
|
|||||||
payloadReader.consume(new ParsableByteArray(), FLAG_PAYLOAD_UNIT_START_INDICATOR);
|
payloadReader.consume(new ParsableByteArray(), FLAG_PAYLOAD_UNIT_START_INDICATOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return RESULT_END_OF_INPUT;
|
return RESULT_END_OF_INPUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user