FragmentedMp4Extractor: allow both first_sample_flags and sample_flags
Having both in the trun box is not allowed (see section section 8.8.8.1 of ISO/IEC 14496-12:2015) but this CL makes the code more robust in case this happens. Before this change, the first sample flag was not read, making subsequent reads incorrect. Issue: #7698 PiperOrigin-RevId: 325212160
This commit is contained in:
parent
5169652575
commit
f29af879c0
@ -1011,8 +1011,10 @@ public class FragmentedMp4Extractor implements Extractor {
|
|||||||
checkNonNegative(sampleDurationsPresent ? trun.readInt() : defaultSampleValues.duration);
|
checkNonNegative(sampleDurationsPresent ? trun.readInt() : defaultSampleValues.duration);
|
||||||
int sampleSize =
|
int sampleSize =
|
||||||
checkNonNegative(sampleSizesPresent ? trun.readInt() : defaultSampleValues.size);
|
checkNonNegative(sampleSizesPresent ? trun.readInt() : defaultSampleValues.size);
|
||||||
int sampleFlags = (i == 0 && firstSampleFlagsPresent) ? firstSampleFlags
|
int sampleFlags =
|
||||||
: sampleFlagsPresent ? trun.readInt() : defaultSampleValues.flags;
|
sampleFlagsPresent
|
||||||
|
? trun.readInt()
|
||||||
|
: (i == 0 && firstSampleFlagsPresent) ? firstSampleFlags : defaultSampleValues.flags;
|
||||||
if (sampleCompositionTimeOffsetsPresent) {
|
if (sampleCompositionTimeOffsetsPresent) {
|
||||||
// The BMFF spec (ISO 14496-12) states that sample offsets should be unsigned integers in
|
// The BMFF spec (ISO 14496-12) states that sample offsets should be unsigned integers in
|
||||||
// version 0 trun boxes, however a significant number of streams violate the spec and use
|
// version 0 trun boxes, however a significant number of streams violate the spec and use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user