Implement ReadOrchestrator class, add highly optimized UrlSource

This commit is contained in:
Vanilagy
2025-08-29 19:39:50 +02:00
parent 641cdd02e3
commit c93755def1
15 changed files with 704 additions and 824 deletions
+1 -4
View File
@@ -26,9 +26,6 @@ export const readNextFrameHeader = async (reader: Reader2, startPos: number, unt
header: FrameHeader;
startPos: number;
} | null> => {
let fileSize = reader.requestSize();
if (fileSize instanceof Promise) fileSize = await fileSize;
let currentPos = startPos;
while (currentPos < until) {
@@ -38,7 +35,7 @@ export const readNextFrameHeader = async (reader: Reader2, startPos: number, unt
const word = readU32Be(slice);
const result = readFrameHeader(word, fileSize - currentPos);
const result = readFrameHeader(word, reader.fileSize - currentPos);
if (result.header) {
return { header: result.header, startPos: currentPos };
}