Check atom size and recording mode of Samsung saut boxes

- In slow motion videos flattened by Samsung, the saut box is kept but
only have the 4 first bytes (author field).
- In Samsung normal videos, the recording mode is zero.

In these cases, skip this box.

PiperOrigin-RevId: 347577303
This commit is contained in:
kimvde 2020-12-15 11:23:21 +00:00 committed by Christos Tsilopoulos
parent 12f1615205
commit 761bd091c3

View file

@ -717,16 +717,15 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
int atomSize = smta.readInt();
int atomType = smta.readInt();
if (atomType == Atom.TYPE_saut) {
if (atomSize < 14) {
return null;
}
smta.skipBytes(5); // author (4), reserved = 0 (1).
int recordingMode = smta.readUnsignedByte();
float captureFrameRate;
if (recordingMode == 12) {
captureFrameRate = 240;
} else if (recordingMode == 13) {
captureFrameRate = 120;
} else {
captureFrameRate = C.RATE_UNSET;
if (recordingMode != 12 && recordingMode != 13) {
return null;
}
float captureFrameRate = recordingMode == 12 ? 240 : 120;
smta.skipBytes(1); // reserved = 1 (1).
int svcTemporalLayerCount = smta.readUnsignedByte();
return new Metadata(new SmtaMetadataEntry(captureFrameRate, svcTemporalLayerCount));