mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 05:13:50 +02:00
Implement ReadOrchestrator class, add highly optimized UrlSource
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user