mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Change requestEntireFile() slice offset logic (#390)
This commit is contained in:
+5
-4
@@ -120,15 +120,16 @@ export class Reader {
|
||||
return this.requestSlice(0, this.fileSizeNonStrict);
|
||||
}
|
||||
|
||||
const startOffset = chunks.length * CHUNK_SIZE;
|
||||
let slice = this.requestSliceRange(startOffset, 0, CHUNK_SIZE);
|
||||
let slice = this.requestSliceRange(currentSize, 0, CHUNK_SIZE);
|
||||
if (slice instanceof Promise) slice = await slice;
|
||||
|
||||
if (!slice) {
|
||||
if (!slice || slice.length === 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
chunks.push(readBytes(slice, slice.length));
|
||||
const chunk = readBytes(slice, slice.length);
|
||||
chunks.push(chunk);
|
||||
|
||||
currentSize += slice.length;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user