mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
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:
parent
12f1615205
commit
761bd091c3
1 changed files with 6 additions and 7 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue