Commit bebbf29a by aquilescanta Committed by Oliver Woodman

Fix NPE when trying to play H265 in Ts files

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136607848
parent 586e6257
......@@ -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()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment