Fix NPE when trying to play H265 in Ts files
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136607848
This commit is contained in:
parent
586e6257cd
commit
bebbf29a78
@ -44,6 +44,7 @@ import java.util.Collections;
|
||||
private static final int SUFFIX_SEI_NUT = 40;
|
||||
|
||||
private TrackOutput output;
|
||||
private SampleReader sampleReader;
|
||||
private SeiReader seiReader;
|
||||
|
||||
// State that should not be reset on seek.
|
||||
@ -56,7 +57,6 @@ import java.util.Collections;
|
||||
private final NalUnitTargetBuffer pps;
|
||||
private final NalUnitTargetBuffer prefixSei;
|
||||
private final NalUnitTargetBuffer suffixSei; // TODO: Are both needed?
|
||||
private final SampleReader sampleReader;
|
||||
private long totalBytesWritten;
|
||||
|
||||
// Per packet state that gets reset at the start of each packet.
|
||||
@ -72,7 +72,6 @@ import java.util.Collections;
|
||||
pps = new NalUnitTargetBuffer(PPS_NUT, 128);
|
||||
prefixSei = new NalUnitTargetBuffer(PREFIX_SEI_NUT, 128);
|
||||
suffixSei = new NalUnitTargetBuffer(SUFFIX_SEI_NUT, 128);
|
||||
sampleReader = new SampleReader(output);
|
||||
seiWrapper = new ParsableByteArray();
|
||||
}
|
||||
|
||||
@ -91,6 +90,7 @@ import java.util.Collections;
|
||||
@Override
|
||||
public void init(ExtractorOutput extractorOutput, TrackIdGenerator idGenerator) {
|
||||
output = extractorOutput.track(idGenerator.getNextId());
|
||||
sampleReader = new SampleReader(output);
|
||||
seiReader = new SeiReader(extractorOutput.track(idGenerator.getNextId()));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user