mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Relax parsing of ctts sample deltas
Issue: #3384 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174715851
This commit is contained in:
parent
2daa098a20
commit
ea80c3e456
1 changed files with 7 additions and 1 deletions
|
|
@ -247,7 +247,13 @@ import java.util.List;
|
|||
remainingSamplesAtTimestampDelta--;
|
||||
if (remainingSamplesAtTimestampDelta == 0 && remainingTimestampDeltaChanges > 0) {
|
||||
remainingSamplesAtTimestampDelta = stts.readUnsignedIntToInt();
|
||||
timestampDeltaInTimeUnits = stts.readUnsignedIntToInt();
|
||||
// The BMFF spec (ISO 14496-12) states that sample deltas should be unsigned integers
|
||||
// in stts boxes, however some streams violate the spec and use signed integers instead.
|
||||
// See https://github.com/google/ExoPlayer/issues/3384. It's safe to always decode sample
|
||||
// deltas as signed integers here, because unsigned integers will still be parsed
|
||||
// correctly (unless their top bit is set, which is never true in practice because sample
|
||||
// deltas are always small).
|
||||
timestampDeltaInTimeUnits = stts.readInt();
|
||||
remainingTimestampDeltaChanges--;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue