Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/boxes/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class mvexBox extends ContainerBox {
static override readonly fourcc = 'mvex' as const;
box_name = 'MovieExtendsBox' as const;
trex: trexBox;
mehd: mehdBox;
mehd?: mehdBox;
mehds: Array<mehdBox>;

trexs: Array<trexBox> = [];
Expand Down
18 changes: 2 additions & 16 deletions src/boxes/stsz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,15 @@ export class stszBox extends FullBox {
let constant = true;
this.version = 0;
this.flags = 0;
if (this.sample_sizes.length > 0) {
let i = 0;
while (i + 1 < this.sample_sizes.length) {
if (this.sample_sizes[i + 1] !== this.sample_sizes[0]) {
constant = false;
break;
} else {
i++;
}
}
} else {
if (this.sample_sizes.length > 0 && this.sample_size === 0) {
constant = false;
}
this.size = 8;
if (!constant) {
this.size += 4 * this.sample_sizes.length;
}
this.writeHeader(stream);
if (!constant) {
stream.writeUint32(0);
} else {
stream.writeUint32(this.sample_sizes[0]);
}
stream.writeUint32(this.sample_size);
stream.writeUint32(this.sample_sizes.length);
if (!constant) {
stream.writeUint32Array(this.sample_sizes);
Expand Down
2 changes: 1 addition & 1 deletion src/isofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ export class ISOFile<TSegmentUser = unknown, TSampleUser = unknown> {
buffer: ISOFile.writeInitializationSegment(
this.ftyp,
moov,
this.moov?.mvex?.mehd.fragment_duration,
this.moov?.mvex?.mehd?.fragment_duration,
),
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export function parseOneBox(
box = new Box(size);
box.type = type as BoxFourCC;
return { code: OK, box, size: box.size };
} else {
size = stream.getEndPosition() - start;
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions tests/conformance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,7 @@ describe('Conformance Tests', () => {
file_groups[groupName].filter(test => {
// FIXME: These files might be correct but I haven't investigated them yet
// Majority of the tests pass so I've left them out for now
const ignoredTests = [
'video_2500000bps_0.mp4',
'a3b-tone-deprot.mp4',
'a4-tone-fragmented.mp4',
'a6_tone_multifile.mp4',
'a7-tone-oddities.mp4',
'a9-aac-samplegroups-edit.mp4',
'hevc/hevc_tiles_multiple_tracks_empty_base.mp4',
'hevc/hevc_tiles_multiple_tracks.mp4',
];
const ignoredTests = ['video_2500000bps_0.mp4'];
return !ignoredTests.includes(test);
}),
)('roundtrip %s', async testName => {
Expand Down