We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0c8691 commit 91f7526Copy full SHA for 91f7526
src/lazyFile.ts
@@ -95,12 +95,12 @@ export class LazyUint8Array {
95
private moveReadHead(wantedChunkNum: number): ReadHead {
96
for (const [i, head] of this.readHeads.entries()) {
97
const fetchStartChunkNum = head.startChunk + head.speed;
98
- const newSpeed = head.speed * 2;
+ const newSpeed = Math.min(this.maxSpeed, head.speed * 2);
99
const wantedIsInNextFetchOfHead =
100
wantedChunkNum >= fetchStartChunkNum &&
101
wantedChunkNum < fetchStartChunkNum + newSpeed;
102
if (wantedIsInNextFetchOfHead) {
103
- head.speed = Math.min(this.maxSpeed, newSpeed);
+ head.speed = newSpeed;
104
head.startChunk = fetchStartChunkNum;
105
if (i !== 0) {
106
// move head to front
0 commit comments