Skip to content

Commit

Permalink
fix index offset in sidx parsing (#6221)
Browse files Browse the repository at this point in the history
(cherry picked from commit e18d394)
  • Loading branch information
nklhtv authored and robwalch committed Feb 17, 2024
1 parent beb3a94 commit 4cd4e1c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/mp4-tools.ts
Expand Up @@ -136,11 +136,13 @@ export function parseSegmentIndex(sidx: Uint8Array): SidxInfo | null {
let firstOffset = 0;

if (version === 0) {
earliestPresentationTime = readUint32(sidx, (index += 4));
firstOffset = readUint32(sidx, (index += 4));
earliestPresentationTime = readUint32(sidx, index);
firstOffset = readUint32(sidx, index + 4);
index += 8;
} else {
earliestPresentationTime = readUint64(sidx, (index += 8));
firstOffset = readUint64(sidx, (index += 8));
earliestPresentationTime = readUint64(sidx, index);
firstOffset = readUint64(sidx, index + 8);
index += 16;
}

// skip reserved
Expand Down

0 comments on commit 4cd4e1c

Please sign in to comment.