Skip to content

🎥 Make videos programmatically with React

make some work again

Jonny Burger1463253f5427
diff --git a/packages/media-parser/src/boxes/iso-base-media/stsd/samples.ts b/packages/media-parser/src/boxes/iso-base-media/stsd/samples.ts
index 702f24f3e1..d1ebaa1249 100644
--- a/packages/media-parser/src/boxes/iso-base-media/stsd/samples.ts
+++ b/packages/media-parser/src/boxes/iso-base-media/stsd/samples.ts
@@ -216,17 +216,7 @@ export const processSample = ({
const bytesRemainingInBox =
boxSize - (iterator.counter.getOffset() - fileOffset);
- const children = parseBoxes({
- iterator,
- allowIncompleteBoxes: false,
- maxBytes: bytesRemainingInBox,
- initialBoxes: [],
- });
-
- if (children.status === 'incomplete') {
- throw new Error('Incomplete boxes are not allowed');
- }
-
+ iterator.discard(bytesRemainingInBox);
return {
sample: {
format: boxFormat,
@@ -246,7 +236,7 @@ export const processSample = ({
bytesPerPacket,
bytesPerFrame,
bitsPerSample,
- children: children.segments,
+ children: [],
},
};
}
diff --git a/packages/media-parser/src/test/parse-esds.test.ts b/packages/media-parser/src/test/parse-esds.test.ts
index 5aed5dfbbe..502a350970 100644
--- a/packages/media-parser/src/test/parse-esds.test.ts
+++ b/packages/media-parser/src/test/parse-esds.test.ts
@@ -4,14 +4,21 @@ import {getArrayBufferIterator} from '../buffer-iterator';
test('Parse ESDS box', () => {
const buf = new Uint8Array([
+ // mock header
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ // actual box
0, 0, 0, 0, 3, 128, 128, 128, 27, 0, 2, 0, 4, 128, 128, 128, 13, 107, 21, 0,
0, 0, 0, 4, 226, 0, 0, 4, 226, 0, 6, 128, 128, 128, 1, 2,
]);
+
+ const iter = getArrayBufferIterator(buf);
+ iter.counter.increment(8);
+
expect(
parseEsds({
- data: getArrayBufferIterator(buf),
- fileOffset: 0,
- size: buf.length + 8,
+ data: iter,
+ fileOffset: 8,
+ size: buf.length - 8,
}),
).toEqual({
type: 'esds-box',