mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 19:33:51 +02:00
Make Matroska block decoding lazy
This commit is contained in:
+2
-1
@@ -12,6 +12,7 @@ import {
|
||||
assert,
|
||||
assertNever,
|
||||
Bitstream,
|
||||
getUint24,
|
||||
last,
|
||||
readExpGolomb,
|
||||
readSignedExpGolomb,
|
||||
@@ -116,7 +117,7 @@ const findNalUnitsInLengthPrefixed = (packetData: Uint8Array, lengthSize: 1 | 2
|
||||
} else if (lengthSize === 2) {
|
||||
nalUnitLength = dataView.getUint16(offset, false);
|
||||
} else if (lengthSize === 3) {
|
||||
nalUnitLength = (dataView.getUint16(offset, false) << 8) + dataView.getUint8(offset + 2);
|
||||
nalUnitLength = getUint24(dataView, offset, false);
|
||||
} else if (lengthSize === 4) {
|
||||
nalUnitLength = dataView.getUint32(offset, false);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user